Skip to content

Commit c34817b

Browse files
committed
[shadow-styling] :ancestor() -> :host-context(), specify that :host-context() only matches the host element.
1 parent 3566e05 commit c34817b

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

shadow-styling/Overview.bs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ Selecting the Host Element: the '':host'' and '':host()'' pseudo-classes</h3>
301301
</div>
302302

303303
<h3 id='ancestor-selector'>
304-
Selecting Based on an Ancestor Outside the Shadow Tree: the '':ancestor()'' pseudo-class</h3>
304+
Selecting Based on an Ancestor Outside the Shadow Tree: the '':host-context()'' pseudo-class</h3>
305305

306306
Ordinary, selectors within a <a>shadow tree</a>
307307
can't see elements outside the <a>shadow tree</a> at all.
@@ -316,15 +316,15 @@ Selecting Based on an Ancestor Outside the Shadow Tree: the '':ancestor()'' pseu
316316
or higher up in the document.
317317
</div>
318318

319-
The <dfn selector>:ancestor()</dfn> functional pseudo-class tests whether there is an ancestor,
319+
The <dfn selector>:host-context()</dfn> functional pseudo-class tests whether there is an ancestor,
320320
outside the <a>shadow tree</a>,
321321
which matches a particular selector.
322322
Its syntax is:
323323

324-
<pre>:ancestor( <<compound-selector>> )</pre>
324+
<pre>:host-context( <<compound-selector>> )</pre>
325325

326326
When evaluated in the context of a <a>shadow tree</a>,
327-
the '':ancestor()'' pseudo-class matches any element,
327+
the '':host-context()'' pseudo-class matches the <a>host element</a>,
328328
if the <a>host element</a> or one of its ancestors matches the provided <<compound-selector>>.
329329
For the purpose of this pseudo-class,
330330
the "ancestor" of an element is its parent,

shadow-styling/Overview.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ <h2 class="no-num no-toc no-ref heading settled heading" id=contents><span class
124124
<li><a href=#selectors><span class=secno>6</span> Shadow DOM Selectors</a>
125125
<ul class=toc>
126126
<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>
127-
<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>
127+
<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=:host-context()>:host-context()</span> pseudo-class</a>
128128
<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>
129129
<li><a href=#conformance><span class=secno></span> Conformance</a>
130130
<ul class=toc>
@@ -427,7 +427,7 @@ <h3 class="heading settled heading" data-level=6.1 id=host-selector><span class=
427427
</div>
428428

429429
<h3 class="heading settled heading" data-level=6.2 id=ancestor-selector><span class=secno>6.2 </span><span class=content>
430-
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>
430+
Selecting Based on an Ancestor Outside the Shadow Tree: the <a class=css data-link-type=maybe href=#selectordef-host-context title=:host-context()>:host-context()</a> pseudo-class</span><a class=self-link href=#ancestor-selector></a></h3>
431431

432432
<p> Ordinary, selectors within a <a data-link-type=dfn href=#shadow-tree title="shadow tree">shadow tree</a>
433433
can’t see elements outside the <a data-link-type=dfn href=#shadow-tree title="shadow tree">shadow tree</a> at all.
@@ -442,14 +442,14 @@ <h3 class="heading settled heading" data-level=6.2 id=ancestor-selector><span cl
442442
or higher up in the document.
443443
</div>
444444

445-
<p> The <dfn class=css-code data-dfn-type=selector data-export="" id=selectordef-ancestor>:ancestor()<a class=self-link href=#selectordef-ancestor></a></dfn> functional pseudo-class tests whether there is an ancestor,
445+
<p> The <dfn class=css-code data-dfn-type=selector data-export="" id=selectordef-host-context>:host-context()<a class=self-link href=#selectordef-host-context></a></dfn> functional pseudo-class tests whether there is an ancestor,
446446
outside the <a data-link-type=dfn href=#shadow-tree title="shadow tree">shadow tree</a>,
447447
which matches a particular selector.
448448
Its syntax is:
449449

450-
<pre>:ancestor( <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/selectors-4/#ltcompound-selector title="<compound-selector>">&lt;compound-selector&gt;</a> )</pre>
450+
<pre>:host-context( <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/selectors-4/#ltcompound-selector title="<compound-selector>">&lt;compound-selector&gt;</a> )</pre>
451451
<p> When evaluated in the context of a <a data-link-type=dfn href=#shadow-tree title="shadow tree">shadow tree</a>,
452-
the <a class=css data-link-type=maybe href=#selectordef-ancestor title=:ancestor()>:ancestor()</a> pseudo-class matches any element,
452+
the <a class=css data-link-type=maybe href=#selectordef-host-context title=:host-context()>:host-context()</a> pseudo-class matches the <a data-link-type=dfn href=#host-element0 title="host element">host element</a>,
453453
if the <a data-link-type=dfn href=#host-element0 title="host element">host element</a> or one of its ancestors matches the provided <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/selectors-4/#ltcompound-selector title="<compound-selector>">&lt;compound-selector&gt;</a>.
454454
For the purpose of this pseudo-class,
455455
the "ancestor" of an element is its parent,
@@ -644,11 +644,11 @@ <h2 class="no-num no-ref heading settled heading" id=index><span class=content>
644644
Index</span><a class=self-link href=#index></a></h2>
645645
<div data-fill-with=index><ul class=indexlist>
646646
<li>active shadow tree, <a href=#active-shadow-tree title="section 2.1">2.1</a>
647-
<li>:ancestor(), <a href=#selectordef-ancestor title="section 6.2">6.2</a>
648647
<li>/content/, <a href=#selectordef-content title="section 5.2">5.2</a>
649648
<li>distribution list, <a href=#distribution-list title="section 2.2">2.2</a>
650649
<li>:host(), <a href=#selectordef-host title="section 6.1">6.1</a>
651650
<li>:host, <a href=#selectordef-host0 title="section 6.1">6.1</a>
651+
<li>:host-context(), <a href=#selectordef-host-context title="section 6.2">6.2</a>
652652
<li>host element, <a href=#host-element0 title="section 2.1">2.1</a>
653653
<li>insertion point, <a href=#insertion-point title="section 2.2">2.2</a>
654654
<li>::shadow, <a href=#selectordef-shadow title="section 6.3">6.3</a>

0 commit comments

Comments
 (0)