@@ -24,7 +24,8 @@ spec:dom; type:dfn;
24
24
text:find slottables
25
25
text:find flattened slottables
26
26
text:element; for:/
27
- spec:html; type:element; text:style
27
+ spec:html; type:element;
28
+ text:style
28
29
spec:selectors-4; type:dfn;
29
30
text: static profile
30
31
text: dynamic profile
@@ -40,7 +41,7 @@ spec:dom; type:dfn; text:child
40
41
spec:css-color-5; type:function; text:color()
41
42
</pre>
42
43
43
- <!--
44
+ <!--
44
45
45
46
<h2 id="intro">
46
47
Introduction</h2>
@@ -507,6 +508,25 @@ Selecting Slot-Assigned Content: the ''::slotted()'' pseudo-element</h4>
507
508
The only way to style assigned text nodes
508
509
is by styling the <a>slot</a> and relying on inheritance.
509
510
511
+ <h4 id='the-has-slotted-pseudo'>
512
+ Matching on the Presence of Slot-Assigned Nodes: the '':has-slotted'' pseudo-class</h4>
513
+
514
+ The <dfn selector>:has-slotted</dfn> pseudo-class
515
+ matches <{slot}> elements
516
+ which have a non-empty list of <a lt="find slottables">slotted nodes</a> .
517
+
518
+ When '':has-slotted'' matches a slot with fallback content,
519
+ we can conclude that the fallback content is <em> not</em> being displayed.
520
+
521
+ Note: Even a single whitespace text node is sufficient to make '':has-slotted'' ' apply.
522
+ This is by design, so that the behavior of this pseudo-class is consistent with the behavior of the {{HTMLSlotElement/assignedNodes()}} method.
523
+ A future version of this specification is expected to introduce a way to exclude this case from matching.
524
+
525
+ Note: It is expected that a future version of this specification will introduce a functional '':has-slotted()'' pseudo-class that allows
526
+ more fine-grained matching by accepting a selector argument.
527
+ '':has-slotted'' is <em> not</em> an alias of '':has-slotted(*)'' ,
528
+ as the latter would not match slotted text nodes, but '':has-slotted'' does.
529
+
510
530
<wpt>
511
531
css-scoping-shadow-slotted-nested.html
512
532
css-scoping-shadow-slotted-rule.html
@@ -968,4 +988,4 @@ which protect them from the things defined in this specification).
968
988
969
989
<wpt hidden>
970
990
chrome-1492368-crash.html
971
- </wpt>
991
+ </wpt>
0 commit comments