W3C home > Mailing lists > Public > public-css-archive@w3.org > July 2018

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

From: Xidorn Quan via GitHub <sysbot+gh@w3.org>
Date: Sun, 08 Jul 2018 23:19:25 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-339267080-1531091964-sysbot+gh@w3.org>
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

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:33 UTC