@@ -25,7 +25,7 @@ spec:html; type:element; text:style
25
25
spec:selectors-4; type:dfn;
26
26
text: static profile
27
27
text: dynamic profile
28
- spec:css-pseudo-4; type:selector;
28
+ spec:css-pseudo-4; type:selector;
29
29
text:::before
30
30
text:::after
31
31
spec:cascade-4; type:dfn; text: inherit
@@ -263,6 +263,20 @@ Selecting Into the Light: the '':host'', '':host()'', and '':host-context()'' ps
263
263
In any other context,
264
264
it matches nothing.
265
265
266
+ The [=specificity=] of '':host'' is that of a pseudo-class.
267
+ The [=specificity=] of '':host()'' is that of a pseudo-class,
268
+ plus the [=specificity=] of its argument.
269
+
270
+ Note: This is different from the specificity of similar pseudo-classes,
271
+ like '':matches()'' or '':not()'' ,
272
+ which <em> only</em> take the specificity of their argument.
273
+ This is because '':host'' is affirmatively selecting an element all by itself,
274
+ like a "normal" pseudo-class;
275
+ it takes a selector argument for syntactic reasons
276
+ (we can't say that '':host.foo'' matches but ''.foo'' doesn't),
277
+ but is otherwise identical
278
+ to just using '':host'' followed by a selector.
279
+
266
280
<div class='example'>
267
281
For example, say you had a component with a <a>shadow tree</a> like the following:
268
282
@@ -310,6 +324,9 @@ Selecting Into the Light: the '':host'', '':host()'', and '':host-context()'' ps
310
324
In any other context,
311
325
it matches nothing.
312
326
327
+ The [=specificity=] of '':host-context()'' is that of a pseudo-class,
328
+ plus the [=specificity=] of its argument.
329
+
313
330
Note: This means that the selector pierces through shadow boundaries on the way up,
314
331
looking for elements that match its argument,
315
332
until it reaches the document root.
@@ -348,6 +365,9 @@ Selecting Slot-Assigned Content: the ''::slotted()'' pseudo-element</h4>
348
365
like ''::slotted()::before'' ,
349
366
representing the appropriate pseudo-element of the elements represented by the ''::slotted()'' pseudo-element.
350
367
368
+ The [=specificity=] of ''::slotted()'' is that of a pseudo-element,
369
+ plus the [=specificity=] of its argument.
370
+
351
371
<div class="example">
352
372
For example, say you had a component with both children and a shadow tree,
353
373
like the following:
0 commit comments