-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for rest of the CSS features and upgrade to 6.x.x #1
Conversation
Another issue is that this ignores A lot of the details in how to assemble formal syntax was worked out in mdn/yari#4656, and the code that implements that is currently query-css-syntax/query-property-syntax.js Lines 48 to 76 in 53c08a1
|
Also the logic for at-rule descriptors assumes that they are in a global namespace, but I don't think they are: for example the https://drafts.csswg.org/mediaqueries/#descdef-media-aspect-ratio ...the values are the same, but I don't see any reason that they have to be the same. |
I've added small infrastructure for testing. Testing changes on yari is very painful. All the types and their syntaxes have been extracted and put under I've made changes for the values inside value issue.
While testing on yari I found that some terms were defined in multiple specs. But in all the cases definitions/values were same. Could you give me an example where it's different? I mean if there is no case where it's different then we can go with this global namespacing right? Otherwise I'll update lookup logic for at-rule descriptors. Also, consider a hypothetical case similar to this, if a user queries |
Yeah, I don't know of any where it's different. But in the absence of any assurance the other way, if they are defined in two separate places, it seems safer to treat them as separate things. I wonder if it is worth asking the CSSWG about it - like, is it possible that the syntax of two at-rule descriptors with the same name might diverge?
Yes, I think we would need something like this. |
There is a flow in the old implementation. No same property object has both
I've implemented this. Now it is mandatory to use |
@wbamberg ping |
Summary
The PR implements following things:
Implementation
Rather than using data provided by webref API as it is, it is better to extract the data as per our needs. This saves us from iterating over the same structure over and over for each API call.
All the data has been collected in seven hash maps for easy look ups. While populating the maps priority has been given to the "current" specs over the latest specs (with -x numbers). This makes the
getSyntax()
always return "current" syntax, and definitions of draft specs or part comes from the numbered specs.Testing
For testing I've used
npm pack
command to create a local packagequery-css-syntax-0.0.4.tgz
and used it in Yari to render{{CSSSyntax}}
macros.All the
mdn/content
documents built usingyarn build
atwebref/css
v5.4.4 were compared with this code atwebref/css
v6.7.1.Apart from small corrections in syntaxes and new available syntaxex both the builds matched exactly.
Yari side code can be found in corresponding PR.