Re: [selectors] Rewrote grammar in terms of the Value Definition Syntax

On 3/17/16, 5:53 PM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:

>As I've been threatening to do for quite some time, I finally rewrote
>the grammar for Selectors in terms of the CSS Value Definition Syntax,
>removing the old grammar written in terms of the Appendix G syntax.
>This is one more step in the effort to remove *all* grammars written
>against the old Appendix G syntax from CSS, now that CSS is no longer
>defined in a way that's directly compatible with it.
>
>Once auto-generation finishes in a few minutes, you can find it at
><https://drafts.csswg.org/selectors/#grammar>.  Please review and let
>me know if you notice any mistakes!

The + combinator, * type-selector, and | ns-prefix character are incorrectly linked to values and units.

I find it a bit odd that <class-selector> is fully defined here, but <id-selector> refers to <hash-token> from CSS Syntax, which is a link to a list of tokens that doesn’t explain the token’s grammar. I see how the grammar is defined in the tokenization algorithm, but it’s not a simple thing to find from the Selectors link. I’d prefer is Selectors had a way to clearly state what the grammar is without this indirection.

Thanks,

Alan

Received on Friday, 18 March 2016 01:37:59 UTC