Skip to content

Commit 43c5786

Browse files
domenicannevk
authored andcommitted
Make <link rel="stylesheet"> work inside shadow trees
Fixes WICG/webcomponents#530.
1 parent 0c45df8 commit 43c5786

File tree

1 file changed

+37
-28
lines changed

1 file changed

+37
-28
lines changed

source

Lines changed: 37 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2129,16 +2129,27 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
21292129

21302130
<p>A <dfn id="insert-an-element-into-a-document" data-x="node is inserted into a document">node is
21312131
inserted into a document</dfn> when the <span data-x="concept-node-insert-ext">insertion
2132-
steps</span> are invoked with it as argument and it is now <span>in a document tree</span>.
2132+
steps</span> are invoked with it as the argument and it is now <span>in a document tree</span>.
21332133
Analogously, a <dfn id="remove-an-element-from-a-document" data-x="node is removed from a
21342134
document">node is removed from a document</dfn> when the <span
2135-
data-x="concept-node-remove-ext">removing steps</span> are invoked with it as argument and it is
2136-
now no longer <span>in a document tree</span>.</p>
2135+
data-x="concept-node-remove-ext">removing steps</span> are invoked with it as the argument and it
2136+
is now no longer <span>in a document tree</span>.</p>
21372137

21382138
<p>A node <dfn>becomes connected</dfn> when the <span data-x="concept-node-insert-ext">insertion
2139-
steps</span> are invoked with it as argument and it is now <span>connected</span>. Analogously, a
2140-
node <dfn>becomes disconnected</dfn> when the <span data-x="concept-node-remove-ext">removing
2141-
steps</span> are invoked with it as argument and it is now no longer <span>connected</span>.</p>
2139+
steps</span> are invoked with it as the argument and it is now <span>connected</span>.
2140+
Analogously, a node <dfn>becomes disconnected</dfn> when the <span
2141+
data-x="concept-node-remove-ext">removing steps</span> are invoked with it as the argument and it
2142+
is now no longer <span>connected</span>.</p>
2143+
2144+
<p>A node is <dfn>browsing-context connected</dfn> when it is <span>connected</span> and its <span
2145+
data-x="shadow-including root">shadow-including root</span> has a <span
2146+
data-x="concept-document-bc">browsing context</span>. A node <dfn>becomes browsing-context
2147+
connected</dfn> when the <span data-x="concept-node-insert-ext">insertion steps</span> are invoked
2148+
with it as the argument and it is now <span>browsing-context connected</span>. A node <dfn>becomes
2149+
browsing-context disconnected</dfn> either when the <span
2150+
data-x="concept-node-remove-ext">removing steps</span> are invoked with it as the argument and it
2151+
is now no longer <span>browsing-context connected</span>, or when its <span>shadow-including
2152+
root</span> no longer has a <span data-x="concept-document-bc">browsing context</span>.
21422153

21432154

21442155
<h4>Scripting</h4>
@@ -3139,7 +3150,7 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
31393150

31403151
<li>The <dfn data-noexport="" data-x-href="https://dom.spec.whatwg.org/#concept-tree">tree</dfn> and <dfn data-noexport="" data-x-href="https://dom.spec.whatwg.org/#concept-shadow-tree">shadow tree</dfn> concepts</li>
31413152
<li>The <dfn data-x-href="https://dom.spec.whatwg.org/#concept-tree-order">tree order</dfn> and <dfn data-x-href="https://dom.spec.whatwg.org/#concept-shadow-including-tree-order">shadow-including tree order</dfn> concepts</li>
3142-
<li>The <dfn data-noexport="" data-x-href="https://dom.spec.whatwg.org/#concept-tree-root">root</dfn> concept</li>
3153+
<li>The <dfn data-x-href="https://dom.spec.whatwg.org/#concept-tree-root">root</dfn> and <dfn data-x-href="https://dom.spec.whatwg.org/#concept-shadow-including-root">shadow-including root</dfn> concepts</li>
31433154
<li>The <dfn data-x-href="https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor">inclusive ancestor</dfn> and <dfn data-x-href="https://dom.spec.whatwg.org/#concept-shadow-including-descendant">shadow-including descendant</dfn> concepts</li>
31443155
<li>The <dfn data-noexport="" data-x-href="https://dom.spec.whatwg.org/#document-element">document element</dfn> concept</li>
31453156
<li>The <dfn data-x-href="https://dom.spec.whatwg.org/#in-a-document-tree">in a document tree</dfn>, <dfn data-x-href="https://dom.spec.whatwg.org/#in-a-document">in a document</dfn> (legacy), and <dfn data-x-href="https://dom.spec.whatwg.org/#connected">connected</dfn> concepts</li>
@@ -23272,39 +23283,37 @@ interface <dfn>HTMLHyperlinkElementUtils</dfn> {
2327223283
<ul>
2327323284

2327423285
<li><p>When the <span>external resource link</span> is created on a <code>link</code> element
23275-
that is already <span>in a document</span> that has a <span data-x="concept-document-bc">browsing
23276-
context</span>.</p></li>
23286+
that is already <span>browsing-context connected</span>.</p></li>
2327723287
<!-- e.g. rel="" changed, href="" set... -->
2327823288

23279-
<li><p>When the <span>external resource link</span>'s <code>link</code> element is <span
23280-
data-x="node is inserted into a document">inserted into a document</span> that has a <span
23281-
data-x="concept-document-bc">browsing context</span>.</p></li>
23289+
<li><p>When the <span>external resource link</span>'s <code>link</code> element <span>becomes
23290+
browsing-context connected</span>.</p></li>
2328223291

2328323292
<li><p>When the <code data-x="attr-link-href">href</code> attribute of the <code>link</code>
23284-
element of an <span>external resource link</span> that is already <span>in a document</span> that
23285-
has a <span data-x="concept-document-bc">browsing context</span> is changed.</p></li>
23293+
element of an <span>external resource link</span> that is already <span>browsing-context
23294+
connected</span> is changed.</p></li>
2328623295
<!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2588 -->
2328723296

2328823297
<li><p>When the <code data-x="attr-link-crossorigin">crossorigin</code> attribute of the
2328923298
<code>link</code> element of an <span data-x="external resource link">external resource
23290-
link</span> that is already <span>in a document</span> that has a <span
23291-
data-x="concept-document-bc">browsing context</span> is set, changed, or removed.</p></li>
23299+
link</span> that is already <span>browsing-context connected</span> is set, changed, or
23300+
removed.</p></li>
2329223301

2329323302
<li><p>When the <code data-x="attr-link-type">type</code> attribute of the <code>link</code>
23294-
element of an <span>external resource link</span> that is already <span>in a document</span> that
23295-
has a <span data-x="concept-document-bc">browsing context</span> is set or changed to a value
23296-
that does not or no longer matches the <span data-x="Content-Type">Content-Type metadata</span>
23297-
of the previous obtained external resource, if any.</p></li>
23303+
element of an <span>external resource link</span> that is already <span>browsing-context
23304+
connected</span> is set or changed to a value that does not or no longer matches the <span
23305+
data-x="Content-Type">Content-Type metadata</span> of the previous obtained external resource, if
23306+
any.</p></li>
2329823307

2329923308
<li><p>When the <code data-x="attr-link-type">type</code> attribute of the <code>link</code>
23300-
element of an <span>external resource link</span> that is already <span>in a document</span> that
23301-
has a <span data-x="concept-document-bc">browsing context</span>, but was previously not obtained
23302-
due to the <code data-x="attr-link-type">type</code> attribute specifying an unsupported type, is
23303-
set, removed, or changed.</p></li>
23304-
23305-
<li><p>When the <span>external resource link</span> changes from being <span data-x="the link is
23306-
an alternative stylesheet">an alternative stylesheet</span> to not being one, or vice
23307-
versa.</p></li>
23309+
element of an <span>external resource link</span> that is already <span>browsing-context
23310+
connected</span>, but was previously not obtained due to the <code
23311+
data-x="attr-link-type">type</code> attribute specifying an unsupported type, is set, removed, or
23312+
changed.</p></li>
23313+
23314+
<li><p>When the <span>external resource link</span> that is already <span>browsing-context
23315+
connected</span> changes from being <span data-x="the link is an alternative stylesheet">an
23316+
alternative stylesheet</span> to not being one, or vice versa.</p></li>
2330823317

2330923318
</ul>
2331023319

0 commit comments

Comments
 (0)