Skip to content

Commit a7a6967

Browse files
committed
[css-scoping] :host-context() ancestor path should follow distribution.
1 parent 553670c commit a7a6967

2 files changed

Lines changed: 32 additions & 8 deletions

File tree

css-scoping/Overview.bs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,22 @@ Selecting Into the Light: the '':host'', '':host()'', and '':host-context()'' ps
339339
the '':host-context()'' pseudo-class matches the <a>host element</a>,
340340
if the <a>host element</a> or one of its ancestors matches the provided <<compound-selector>>.
341341
For the purpose of this pseudo-class,
342-
the "ancestor" of an element is its parent,
343-
if it has one,
344-
or else its <a>host element</a>,
345-
if it has one.
342+
the "ancestor" of an element is:
343+
344+
<dl>
345+
<dt>if the element is distributed to a <a>distribution list</a>
346+
<dd>
347+
the <a element>content</a> element it is ultimately distributed to.
348+
349+
<dt>if the element is a top-most element in a shadow tree
350+
<dd>
351+
the <a>host element</a>
352+
353+
<dt>otherwise
354+
<dd>
355+
the element's parent,
356+
if it has one.
357+
</dl>
346358

347359
Note: This means that the selector pierces through shadow boundaries on the way up,
348360
looking for elements that match its argument,

css-scoping/Overview.html

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -465,10 +465,22 @@ <h4 class="heading settled heading" data-level=3.2.1 id=host-selector><span clas
465465
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>,
466466
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>.
467467
For the purpose of this pseudo-class,
468-
the "ancestor" of an element is its parent,
469-
if it has one,
470-
or else its <a data-link-type=dfn href=#host-element0 title="host element">host element</a>,
471-
if it has one.
468+
the "ancestor" of an element is:
469+
470+
<dl>
471+
<dt>if the element is distributed to a <a data-link-type=dfn href=#distribution-list title="distribution list">distribution list</a>
472+
<dd>
473+
the <a data-link-type=element title=content>content</a> element it is ultimately distributed to.
474+
475+
<dt>if the element is a top-most element in a shadow tree
476+
<dd>
477+
the <a data-link-type=dfn href=#host-element0 title="host element">host element</a>
478+
479+
<dt>otherwise
480+
<dd>
481+
the element’s parent,
482+
if it has one.
483+
</dl>
472484

473485
<p class=note> Note: This means that the selector pierces through shadow boundaries on the way up,
474486
looking for elements that match its argument,

0 commit comments

Comments
 (0)