Skip to content

Commit e7244b1

Browse files
authored
[selectors-4] Allow logical combination pseudos wherever their arguments are themselves valid. #7085 (#8041)
1 parent d50d756 commit e7244b1

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

selectors-4/Overview.bs

+22-2
Original file line numberDiff line numberDiff line change
@@ -812,8 +812,6 @@ Pseudo-classing Pseudo-elements</h4>
812812
unless otherwise-specified, none of these <a>pseudo-classes</a>
813813
will match on the <a>pseudo-element</a>.
814814

815-
Issue: Clarify that '':not()'' and '':is()'' can be used when containing above-mentioned pseudos.
816-
817815
<div class="example">
818816
For example, since the '':hover'' pseudo-class specifies
819817
that it can apply to any pseudo-element,
@@ -831,8 +829,14 @@ Pseudo-classing Pseudo-elements</h4>
831829
whereas ''::first-line:hover'' only matches if the first line itself is hovered.
832830
</div>
833831

832+
The [=logical combination pseudo-classes=]
833+
'':not()'', '':is()'', and '':where()''
834+
are also valid immediately following a [=pseudo-element=]
835+
provided their arguments all adhere to the above restriction.
836+
834837
Note: Note that, unless otherwise specified in a future specification,
835838
pseudo-classes other than the <a href="#useraction-pseudos">user action pseudo-classes</a>
839+
(and logical combination pseudo-classes restricted to them)
836840
are not valid when compounded to a pseudo-element;
837841
so, for example, ''::before:first-child'' is an invalid selector.
838842

@@ -988,6 +992,22 @@ Invalid Selectors and Error Handling</h3>
988992
<h2 id="logical-combination">
989993
Logical Combinations</h2>
990994

995+
Selector logic can be manipulated by
996+
[=compound selector|compounding=] (logical AND),
997+
[=selector lists=] (logical OR),
998+
and the <dfn>logical combination pseudo-classes</dfn>
999+
'':is()'', '':where()'', and '':not()''.
1000+
The [=logical combination pseudo-classes=]
1001+
are allowed anywhere that any other [=pseudo-classes=] are allowed,
1002+
but pass any restrictions to their arguments.
1003+
(For example, if only [=compound selectors=] are allowed,
1004+
then only [=compound selectors=] are valid within an '':is()''.)
1005+
1006+
Note: Since inside '':is()'' and '':where()''
1007+
invalid arguments are dropped without invaliding the [=pseudo-class=] itself,
1008+
selector arguments that are invalidated by contextual restrictions
1009+
likewise do not invalidate the '':is()'' pseudo-class itself.
1010+
9911011
<h3 id="grouping">
9921012
Selector Lists</h3>
9931013

0 commit comments

Comments
 (0)