Re: [csswg-drafts] [selectors] Error handling is not exhaustive?

@annevk 

> The negation pseudo-class, :not(), is a functional pseudo-class taking a selector list as an argument.

> A list of simple/compound/complex selectors is a comma-separated list of simple, compound, or complex selectors. This is also called just a selector list when the type is either unimportant or specified in the surrounding prose; if the type is important and unspecified, it defaults to meaning a list of complex selectors.

> A complex selector is a sequence of one or more compound selectors separated by combinators.

> A compound selector is a sequence of simple selectors that are not separated by a combinator

> A simple selector is a single condition on an element. A type selector, universal selector, attribute selector, class selector, ID selector, or pseudo-class is a simple selector.

`1` and `1px` do not match the grammars for type selectors, universal selectors, attribute selectors, class selectors, ID selectors, or pseudo-classes. Therefore they are not valid simple selectors, therefore not valid compound selectors, therefore not valid complex selectors, therefore not a valid selector list, therefore not a valid argument to `:not()`, therefore it is a parsing error in that selector (being a token which is not allowed at that parsing point) and `:not()` is invalid and any selector containing it is also invalid.

-- 
GitHub Notification of comment by fantasai
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2352#issuecomment-438860885 using your GitHub account

Received on Wednesday, 14 November 2018 23:43:43 UTC