Re: [csswg-drafts] [selectors-4] Allow more pseudo-classes following a pseudo-element (#7085)

> In [18. Grammar](https://drafts.csswg.org/selectors-4/#grammar), a whitespace should also be forbidden:

Yup, amended the prohibition between top-level components of `<compound-selector>` to also apply to `<pseudo-compound-selector>`, and additionally prohibited it between the components of a `<complex-unit>` (which I just added to make this easier to talk about).

> Pseudo-elements are forbidden in :is(), :where(), :not(), :has(), :nth-*-child(), either in prose or with syntax, which is inconsistent.

I've redefined `<forgiving-selector-list>` to use `<complex-real-selector>`; no need for an additional grammar term. If we ever allow :is()/:where() to do pseudo-elements, we can just change this definition. I also fixed :not() to say its argument is a `<complex-real-selector-list>`.

I've left the prose forbidding pseudo-elements, tho; it's useful to have that called out explicitly rather than just being implicit from the grammar.

> The argument of logical combination pseudo-classes following a pseudo-element should be restricted to the same set of pseudo-classes allowed to follow the pseudo-element.

Ah yes, that text was slightly too restrictive in what it was talking about. Fixed. (It was just a note, and the normative text it was duplicating did have the correct wording.)

> A compound selector preceding a pseudo-compound selector is excluded from the definition of the latter.
> div::before::marker:hover is not defined, only ::before:hover.

I'm not sure where you're getting that from. `div::before::marker:hover` is definitely allowed by the grammar (both now that I've provided `<complex-unit>`, and before when it was just expanded in-place).

The prose definition did make mention of it being preceded by a compound selector, explicitly, which I've fixed as part of another edit. Now it correctly mentions that it can be preceded by a compound or pseudo-compound selector.

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 12 December 2022 23:16:26 UTC