-
Notifications
You must be signed in to change notification settings - Fork 711
[selectors] some inconsistent concepts and descriptions #386
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
Comments
I agree that order of the simple selectors in the compound selector is sometimes meaningful and the grammar should reflect it. For example, is Maybe the definition of the compound selector chould be changed from
And one more question about pseudo elements: the spec currently explicitly allows pseudo-classing for some pseudo-elements (and this is widely supported in browsers, e.g. in form of @fantasai, @tabatkins, could you please clarify this a bit? |
OK, I've tightened up the grammar:
@wargrey , @SelenIT , @dbaron Would you mind reviewing and letting me know if things look good now, or if anything further needs adjustment? |
For me, everything looks clear and consistent now. Maybe only the |
I'd have to rewrite
instead of
Upside is it's slightly simpler grammar, downside I guess is that |
Yeah, whether you write complex-selector in terms of relative-selectors, or vice versa, is an arbitrary choice. Because complex selectors are a more fundamental concept, I chose to base relative-selector off of complex-selector - in the spec, we don't talk about complex selectors as being built out of relative selectors, a relative selector is just a special type of complex selector that starts with a combinator. Your edits otherwise look fine, @fantasai. None of them were necessary - the additional conditions at the end covered things just fine - but moving them into the grammar works just as well. |
People get less confused when easily grammar-representable restrictions are represented in the grammar. :) (Imho the opposite is true if the grammar becomes overly convoluted, but it doesn't here.) |
The Working Group just discussed
The full IRC log of that discussion<dael> Topic: [selectors] some inconsistent concepts and descriptions<dael> github: https://github.com//issues/386 <dael> fantasai: Request to review some changes to selector grammer which are outlined in a comment. <fantasai> https://github.com//issues/386#issuecomment-354649902 <dael> fantasai: What I did was put the restriction on type selectors and psuedo elments into the grammar rather than just the prose. I wanted to check if there were concerns. <fantasai> * ordering thereof <dael> Rossen_: I don't believe we, Edge, have an issue on this. I think we briefly discussed and it should be fine. <dael> Rossen_: Seemed TabAtkins was also saying he's fine. <dael> fantasai: I believe it should make no difference to impl. If you dn't understand a selector you have to throw it out wither it's ordering or not, but I wanted to check if it's okay to put in grammar. <dael> Rossen_: sgtm. Obj? <dael> RESOLVED: Accept the proposed changes outlined here: https://github.com//issues/386#issuecomment-354649902 |
https://drafts.csswg.org/selectors/#syntax
https://drafts.csswg.org/selectors/#simple
https://drafts.csswg.org/selectors/#grammar
Only the grammar defines pseudo elements are simple elements, this is okay syntactically. Also, is it only one pseudo element that can be attached to the originating element? If it is not, do they share the same originating element(rather than, say, the 2nd one is the originating element of the 3rd one)?
This change is not mentioned in the grammar section.
The text was updated successfully, but these errors were encountered: