[csswg-drafts] [css-nesting] Semantic of nesting selector is unclear

upsuper has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-nesting] Semantic of nesting selector is unclear ==
The current spec says
> When used in the selector of a nested style rule, the nesting selector represents the elements matched by the parent rule.

It is unclear whether `&` in a selector means an element matched by the parent rule, or any elements matched by the parent rule. This affects what would happen when multiple nesting selectors appear in a single complex selector.

For example, should `a, b { & c & { } }` matches nothing (in the former semantic that a `&` always means a single element, and since an element cannot be its descendant, this selector is nonsense), or `:matches(a, b) c :matches(a, b)` (in the latter semantic).

This may significantly affect how nesting rules would be implemented, and I suppose the former semantic may be easier to implement efficiently.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2895 using your GitHub account

Received on Sunday, 8 July 2018 23:19:28 UTC