You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<li><ahref=#content-combinator><spanclass=secno>5.3</span> Selecting Distributed Elements: the <spanclass=cssdata-link-type=maybetitle=/content/>/content/</span> combinator</a></ul>
125
125
<li><ahref=#selectors><spanclass=secno>6</span> Shadow DOM Selectors</a>
126
126
<ulclass=toc>
127
-
<li><ahref=#top-selector><spanclass=secno>6.1</span> Selecting Root-like Elements: the <spanclass=cssdata-link-type=maybetitle=:top>:top</span> pseudo-class</a>
128
-
<li><ahref=#host-selector><spanclass=secno>6.2</span> Selecting the Host Element: the <spanclass=cssdata-link-type=maybetitle=:host>:host</span> and <spanclass=cssdata-link-type=maybetitle=:host()>:host()</span> pseudo-classes</a>
129
-
<li><ahref=#ancestor-selector><spanclass=secno>6.3</span> Selecting Based on an Ancestor Outside the Shadow Tree: the <spanclass=cssdata-link-type=maybetitle=:ancestor()>:ancestor()</span> pseudo-class</a>
130
-
<li><ahref=#shadow-pseudoelement><spanclass=secno>6.4</span> Selecting the Shadow Root Itself: the <spanclass=cssdata-link-type=maybetitle=::shadow>::shadow</span> pseudo-element</a></ul>
127
+
<li><ahref=#host-selector><spanclass=secno>6.1</span> Selecting the Host Element: the <spanclass=cssdata-link-type=maybetitle=:host>:host</span> and <spanclass=cssdata-link-type=maybetitle=:host()>:host()</span> pseudo-classes</a>
128
+
<li><ahref=#ancestor-selector><spanclass=secno>6.2</span> Selecting Based on an Ancestor Outside the Shadow Tree: the <spanclass=cssdata-link-type=maybetitle=:ancestor()>:ancestor()</span> pseudo-class</a>
129
+
<li><ahref=#shadow-pseudoelement><spanclass=secno>6.3</span> Selecting the Shadow Root Itself: the <spanclass=cssdata-link-type=maybetitle=::shadow>::shadow</span> pseudo-element</a></ul>
Selecting Root-like Elements: the <aclass=cssdata-link-type=maybehref=#selectordef-toptitle=:top>:top</a> pseudo-class</span><aclass=self-linkhref=#top-selector></a></h3>
426
-
427
-
<p> The <dfnclass=css-codedata-dfn-type=selectordata-export="" id=selectordef-top>:top<aclass=self-linkhref=#selectordef-top></a></dfn> pseudo-class
428
-
matches all elements which are not the children of other elements.
429
-
These are called <dfndata-dfn-type=dfndata-export="" id=top-level-elementtitle="top-level element">top-level elements<aclass=self-linkhref=#top-level-element></a></dfn>.
430
-
431
-
<divclass=example>
432
-
For example, the root of a document has no element parent.
433
-
(In the DOM, it’s the child of a <code>Document</code> object,
434
-
which is not an element.)
435
-
436
-
<p> Similarly, elements that are children of a <code>ShadowRoot</code> object do not have element parents,
437
-
nor do elements that are appended directly to a <code>DocumentFragment</code>.
438
-
</div>
439
-
440
-
<pclass=note> Note: Note that this definition is based on the data model of the host document,
441
-
not necessarily the data model of Selectors.
442
-
For example, <adata-link-type=dfnhref=#top-level-elementtitle="top-level elements">top-level elements</a> in a <adata-link-type=dfnhref=#shadow-treetitle="shadow tree">shadow tree</a>
443
-
are considered to have the <adata-link-type=dfnhref=#host-element0title="host element">host element</a> as their parent
444
-
<em>for the purposes of Selectors</em>,
445
-
but they still match <aclass=cssdata-link-type=maybehref=#selectordef-toptitle=:top>:top</a> as they are not actually the child of an element.
Selecting the Host Element: the <aclass=cssdata-link-type=maybehref=#selectordef-host0title=:host>:host</a> and <aclass=cssdata-link-type=maybehref=#selectordef-hosttitle=:host()>:host()</a> pseudo-classes</span><aclass=self-linkhref=#host-selector></a></h3>
449
433
450
434
<p> The <dfnclass=css-codedata-dfn-type=selectordata-export="" id=selectordef-host0>:host<aclass=self-linkhref=#selectordef-host0></a></dfn> pseudo-class,
Selecting Based on an Ancestor Outside the Shadow Tree: the <aclass=cssdata-link-type=maybehref=#selectordef-ancestortitle=:ancestor()>:ancestor()</a> pseudo-class</span><aclass=self-linkhref=#ancestor-selector></a></h3>
490
474
491
475
<p> Ordinary, selectors within a <adata-link-type=dfnhref=#shadow-treetitle="shadow tree">shadow tree</a>
Selecting the Shadow Root Itself: the <aclass=cssdata-link-type=maybehref=#selectordef-shadowtitle=::shadow>::shadow</a> pseudo-element</span><aclass=self-linkhref=#shadow-pseudoelement></a></h3>
525
509
526
510
<p> If an element has at least one <adata-link-type=dfnhref=#shadow-treetitle="shadow tree">shadow tree</a>,
0 commit comments