Skip to content

Commit 16dc22b

Browse files
committed
[css-nesting-1] Clarify what exactly is preserved. Also rephrase note for clarity.
1 parent 397994c commit 16dc22b

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

css-nesting-1/Overview.bs

+10-6
Original file line numberDiff line numberDiff line change
@@ -577,16 +577,20 @@ Syntax {#syntax}
577577
a <<delim-token>> with the value "&" (U+0026 AMPERSAND) was encountered.
578578

579579
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=].
580+
so as to catch cases like '':is(:unknown(&), .bar)'',
581+
where an unknown selector
582+
(which, being unknown, we have no way of knowing
583+
whether the argument is <em>meant</em> to be parsed as a selector or not)
584+
is the only part of the selector that contains an ''&''.
585+
As that <em>might</em> be a perfectly valid selector
586+
that's only supported by newer browsers,
587+
and we don't want parsing to be dependent on unrelated versioning issues,
588+
we treat it as still [=containing the nesting selector=].
585589
</div>
586590

587591
If a <<forgiving-selector-list>> has an item that [=contains the nesting selector=]
588592
but is invalid,
589-
it is preserved exactly as-is
593+
that item is preserved exactly as-is
590594
rather than being discarded.
591595
(This does not change the matching behavior of the selector--
592596
an invalid selector still fails to match anything--

0 commit comments

Comments
 (0)