@@ -34,7 +34,8 @@ Introduction</h2>
34
34
Module Interactions</h3>
35
35
36
36
This module introduces new parser rules that extend the [[!CSS21]] parser model.
37
- This module introduces selectors that extend the [[SELECTORS4]] module.
37
+ It introduces selectors that extend the [[SELECTORS-4]] module.
38
+ It extends and modifies some IDL and algorithms defined in the [[CSSOM-1]] module.
38
39
39
40
<h3 id="values">
40
41
Values</h3>
@@ -268,7 +269,7 @@ Syntax {#syntax}
268
269
are relative to the elements represented by the [=nesting selector=] .
269
270
* If a selector in the <<relative-selector-list>>
270
271
does not start with a [=combinator=]
271
- but does contain the [= nesting selector=] ,
272
+ but does [= contain the nesting selector=] ,
272
273
it is interpreted as a non-[=relative selector=] .
273
274
274
275
The precise details of how nested style rules are parsed
@@ -570,6 +571,31 @@ Syntax {#syntax}
570
571
</pre>
571
572
</div>
572
573
574
+ <div algorithm>
575
+ A selector is said to <dfn export>contain the nesting selector</dfn>
576
+ if, when it was [=CSS/parsed=] as any type of selector,
577
+ a <<delim-token>> with the value "&" (U+0026 AMPERSAND) was encountered.
578
+
579
+ Note: This is phrased in this explicit manner
580
+ so as to catch cases like '':is(&:unknown, .bar)'' ,
581
+ which discards its first argument during parsing
582
+ (since it contains an unknown pseudo-class,
583
+ and thus is an [=invalid selector=] ).
584
+ A selector like this still [=contains the nesting selector=] .
585
+ </div>
586
+
587
+ If a <<forgiving-selector-list>> has an item that [=contains the nesting selector=]
588
+ but is invalid,
589
+ it is preserved exactly as-is
590
+ rather than being discarded.
591
+ (This does not change the matching behavior of the selector--
592
+ an invalid selector still fails to match anything--
593
+ just the serialization of the selector.)
594
+
595
+ Issue: The preceding paragraph needs to move to Selectors
596
+ when we move ''&'' itself to Selectors;
597
+ I'm monkey-patching for convenience here.
598
+
573
599
574
600
575
601
<!--
@@ -1171,4 +1197,4 @@ that starts with an ident or function token,
1171
1197
do nothing and return.
1172
1198
1173
1199
Issue: The above paragraph will be inlined into the CSSOM algo,
1174
- rather than monkey-patched.
1200
+ rather than monkey-patched.
0 commit comments