Skip to content

Commit a17f165

Browse files
committed
[shadow-styling] Kill the :top pseudoclass.
1 parent 4af8564 commit a17f165

2 files changed

Lines changed: 27 additions & 59 deletions

File tree

shadow-styling/Overview.bs

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ Shadow Trees</h3>
3939
Instead, the contents of the <a>active shadow tree</a> generates boxes
4040
as if it were the contents of the element instead.
4141

42+
In several instances in shadow DOM,
43+
elements don't have element parents
44+
(instead, they may have a <a>shadow root</a> as parent,
45+
or something else).
46+
An element without a parent,
47+
or whose parent is not an element,
48+
is called a <dfn export>top-level element</dfn>.
49+
4250
<h3 id='distribution-lists'>
4351
Distribution Lists</h3>
4452

@@ -292,29 +300,6 @@ Shadow DOM Selectors</h2>
292300
Shadow DOM defines a few new selectors
293301
to help select elements in useful way related to Shadow DOM.
294302

295-
<h3 id='top-selector'>
296-
Selecting Root-like Elements: the '':top'' pseudo-class</h3>
297-
298-
The <dfn selector>:top</dfn> pseudo-class
299-
matches all elements which are not the children of other elements.
300-
These are called <dfn export title="top-level element">top-level elements</dfn>.
301-
302-
<div class='example'>
303-
For example, the root of a document has no element parent.
304-
(In the DOM, it's the child of a <code>Document</code> object,
305-
which is not an element.)
306-
307-
Similarly, elements that are children of a <code>ShadowRoot</code> object do not have element parents,
308-
nor do elements that are appended directly to a <code>DocumentFragment</code>.
309-
</div>
310-
311-
Note: Note that this definition is based on the data model of the host document,
312-
not necessarily the data model of Selectors.
313-
For example, <a>top-level elements</a> in a <a>shadow tree</a>
314-
are considered to have the <a>host element</a> as their parent
315-
<em>for the purposes of Selectors</em>,
316-
but they still match '':top'' as they are not actually the child of an element.
317-
318303
<h3 id='host-selector'>
319304
Selecting the Host Element: the '':host'' and '':host()'' pseudo-classes</h3>
320305

shadow-styling/Overview.html

Lines changed: 19 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,9 @@ <h2 class="no-num no-toc no-ref heading settled heading" id=contents><span class
124124
<li><a href=#content-combinator><span class=secno>5.3</span> Selecting Distributed Elements: the <span class=css data-link-type=maybe title=/content/>/content/</span> combinator</a></ul>
125125
<li><a href=#selectors><span class=secno>6</span> Shadow DOM Selectors</a>
126126
<ul class=toc>
127-
<li><a href=#top-selector><span class=secno>6.1</span> Selecting Root-like Elements: the <span class=css data-link-type=maybe title=:top>:top</span> pseudo-class</a>
128-
<li><a href=#host-selector><span class=secno>6.2</span> Selecting the Host Element: the <span class=css data-link-type=maybe title=:host>:host</span> and <span class=css data-link-type=maybe title=:host()>:host()</span> pseudo-classes</a>
129-
<li><a href=#ancestor-selector><span class=secno>6.3</span> Selecting Based on an Ancestor Outside the Shadow Tree: the <span class=css data-link-type=maybe title=:ancestor()>:ancestor()</span> pseudo-class</a>
130-
<li><a href=#shadow-pseudoelement><span class=secno>6.4</span> Selecting the Shadow Root Itself: the <span class=css data-link-type=maybe title=::shadow>::shadow</span> pseudo-element</a></ul>
127+
<li><a href=#host-selector><span class=secno>6.1</span> Selecting the Host Element: the <span class=css data-link-type=maybe title=:host>:host</span> and <span class=css data-link-type=maybe title=:host()>:host()</span> pseudo-classes</a>
128+
<li><a href=#ancestor-selector><span class=secno>6.2</span> Selecting Based on an Ancestor Outside the Shadow Tree: the <span class=css data-link-type=maybe title=:ancestor()>:ancestor()</span> pseudo-class</a>
129+
<li><a href=#shadow-pseudoelement><span class=secno>6.3</span> Selecting the Shadow Root Itself: the <span class=css data-link-type=maybe title=::shadow>::shadow</span> pseudo-element</a></ul>
131130
<li><a href=#conformance><span class=secno></span> Conformance</a>
132131
<ul class=toc>
133132
<li><a href=#conventions><span class=secno></span> Document conventions</a>
@@ -174,6 +173,14 @@ <h3 class="heading settled heading" data-level=2.1 id=shadow-trees><span class=s
174173
Instead, the contents of the <a data-link-type=dfn href=#active-shadow-tree title="active shadow tree">active shadow tree</a> generates boxes
175174
as if it were the contents of the element instead.
176175

176+
<p> In several instances in shadow DOM,
177+
elements don’t have element parents
178+
(instead, they may have a <a data-link-type=dfn title="shadow root">shadow root</a> as parent,
179+
or something else).
180+
An element without a parent,
181+
or whose parent is not an element,
182+
is called a <dfn data-dfn-type=dfn data-export="" id=top-level-element>top-level element<a class=self-link href=#top-level-element></a></dfn>.
183+
177184
<h3 class="heading settled heading" data-level=2.2 id=distribution-lists><span class=secno>2.2 </span><span class=content>
178185
Distribution Lists</span><a class=self-link href=#distribution-lists></a></h3>
179186

@@ -421,30 +428,7 @@ <h2 class="heading settled heading" data-level=6 id=selectors><span class=secno>
421428
<p> Shadow DOM defines a few new selectors
422429
to help select elements in useful way related to Shadow DOM.
423430

424-
<h3 class="heading settled heading" data-level=6.1 id=top-selector><span class=secno>6.1 </span><span class=content>
425-
Selecting Root-like Elements: the <a class=css data-link-type=maybe href=#selectordef-top title=:top>:top</a> pseudo-class</span><a class=self-link href=#top-selector></a></h3>
426-
427-
<p> The <dfn class=css-code data-dfn-type=selector data-export="" id=selectordef-top>:top<a class=self-link href=#selectordef-top></a></dfn> pseudo-class
428-
matches all elements which are not the children of other elements.
429-
These are called <dfn data-dfn-type=dfn data-export="" id=top-level-element title="top-level element">top-level elements<a class=self-link href=#top-level-element></a></dfn>.
430-
431-
<div class=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-
<p class=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, <a data-link-type=dfn href=#top-level-element title="top-level elements">top-level elements</a> in a <a data-link-type=dfn href=#shadow-tree title="shadow tree">shadow tree</a>
443-
are considered to have the <a data-link-type=dfn href=#host-element0 title="host element">host element</a> as their parent
444-
<em>for the purposes of Selectors</em>,
445-
but they still match <a class=css data-link-type=maybe href=#selectordef-top title=:top>:top</a> as they are not actually the child of an element.
446-
447-
<h3 class="heading settled heading" data-level=6.2 id=host-selector><span class=secno>6.2 </span><span class=content>
431+
<h3 class="heading settled heading" data-level=6.1 id=host-selector><span class=secno>6.1 </span><span class=content>
448432
Selecting the Host Element: the <a class=css data-link-type=maybe href=#selectordef-host0 title=:host>:host</a> and <a class=css data-link-type=maybe href=#selectordef-host title=:host()>:host()</a> pseudo-classes</span><a class=self-link href=#host-selector></a></h3>
449433

450434
<p> The <dfn class=css-code data-dfn-type=selector data-export="" id=selectordef-host0>:host<a class=self-link href=#selectordef-host0></a></dfn> pseudo-class,
@@ -485,7 +469,7 @@ <h3 class="heading settled heading" data-level=6.2 id=host-selector><span class=
485469
</ul>
486470
</div>
487471

488-
<h3 class="heading settled heading" data-level=6.3 id=ancestor-selector><span class=secno>6.3 </span><span class=content>
472+
<h3 class="heading settled heading" data-level=6.2 id=ancestor-selector><span class=secno>6.2 </span><span class=content>
489473
Selecting Based on an Ancestor Outside the Shadow Tree: the <a class=css data-link-type=maybe href=#selectordef-ancestor title=:ancestor()>:ancestor()</a> pseudo-class</span><a class=self-link href=#ancestor-selector></a></h3>
490474

491475
<p> Ordinary, selectors within a <a data-link-type=dfn href=#shadow-tree title="shadow tree">shadow tree</a>
@@ -520,7 +504,7 @@ <h3 class="heading settled heading" data-level=6.3 id=ancestor-selector><span cl
520504
looking for elements that match its argument,
521505
until it reaches the document root.
522506

523-
<h3 class="heading settled heading" data-level=6.4 id=shadow-pseudoelement><span class=secno>6.4 </span><span class=content>
507+
<h3 class="heading settled heading" data-level=6.3 id=shadow-pseudoelement><span class=secno>6.3 </span><span class=content>
524508
Selecting the Shadow Root Itself: the <a class=css data-link-type=maybe href=#selectordef-shadow title=::shadow>::shadow</a> pseudo-element</span><a class=self-link href=#shadow-pseudoelement></a></h3>
525509

526510
<p> If an element has at least one <a data-link-type=dfn href=#shadow-tree title="shadow tree">shadow tree</a>,
@@ -693,20 +677,19 @@ <h2 class="no-num no-ref heading settled heading" id=index><span class=content>
693677
Index</span><a class=self-link href=#index></a></h2>
694678
<div data-fill-with=index><ul class=indexlist>
695679
<li>active shadow tree, <a href=#active-shadow-tree title="section 2.1">2.1</a>
696-
<li>:ancestor(), <a href=#selectordef-ancestor title="section 6.3">6.3</a>
680+
<li>:ancestor(), <a href=#selectordef-ancestor title="section 6.2">6.2</a>
697681
<li>/content/, <a href=#selectordef-content title="section 5.3">5.3</a>
698682
<li>distribution list, <a href=#distribution-list title="section 2.2">2.2</a>
699-
<li>:host(), <a href=#selectordef-host title="section 6.2">6.2</a>
700-
<li>:host, <a href=#selectordef-host0 title="section 6.2">6.2</a>
683+
<li>:host(), <a href=#selectordef-host title="section 6.1">6.1</a>
684+
<li>:host, <a href=#selectordef-host0 title="section 6.1">6.1</a>
701685
<li>host element, <a href=#host-element0 title="section 2.1">2.1</a>
702686
<li>insertion point, <a href=#insertion-point title="section 2.2">2.2</a>
703-
<li>::shadow, <a href=#selectordef-shadow title="section 6.4">6.4</a>
687+
<li>::shadow, <a href=#selectordef-shadow title="section 6.3">6.3</a>
704688
<li>/shadow/, <a href=#selectordef-shadow0 title="section 5.1">5.1</a>
705689
<li>/shadow-deep/, <a href=#selectordef-shadow-deep title="section 5.2">5.2</a>
706690
<li>shadow host, <a href=#shadow-host title="section 2.1">2.1</a>
707691
<li>shadow tree, <a href=#shadow-tree title="section 2.1">2.1</a>
708-
<li>:top, <a href=#selectordef-top title="section 6.1">6.1</a>
709-
<li>top-level element, <a href=#top-level-element title="section 6.1">6.1</a>
692+
<li>top-level element, <a href=#top-level-element title="section 2.1">2.1</a>
710693
</ul></div>
711694

712695
<h2 class="no-num no-ref heading settled heading" id=property-index><span class=content>

0 commit comments

Comments
 (0)