@@ -2885,6 +2885,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
2885
2885
<li><dfn data-x-href="https://dom.spec.whatwg.org/#interface-element"><code>Element</code></dfn> interface</li>
2886
2886
<li><dfn data-x="dom-Element-attachShadow" data-x-href="https://dom.spec.whatwg.org/#dom-element-attachshadow"><code>attachShadow()</code></dfn> method.</li>
2887
2887
<li>An element's <dfn data-x="concept-element-shadow-root" data-x-href="https://dom.spec.whatwg.org/#concept-element-shadow-root">shadow root</dfn></li>
2888
+ <li>A <span data-x="concept-element-shadow-root">shadow root</span>'s <dfn data-x="concept-shadow-root-mode" data-x-href="https://dom.spec.whatwg.org/#shadowroot-mode">mode</dfn></li>
2889
+ <li>A <span data-x="concept-element-shadow-root">shadow root</span>'s <dfn data-x="concept-is-declarative-shadow-root" data-x-href="https://dom.spec.whatwg.org/#dom-is-declarative-shadow-root">is declarative shadow root</dfn> flag</li>
2890
+ <li>The <dfn data-x="concept-attach-a-shadow-root" data-x-href="https://dom.spec.whatwg.org/#concept-attach-a-shadow-root">attach a
2891
+ shadow root</dfn> algorithm</li>
2892
+ <li>The <dfn data-x="dom-element-shadowroot" data-x-href="https://dom.spec.whatwg.org/#dom-element-shadowroot">shadowRoot</dfn> attribute</li>
2888
2893
<li>The <dfn data-x="dom-retarget" data-x-href="https://dom.spec.whatwg.org/#retarget">retargeting algorithm</dfn></li>
2889
2894
<li><dfn data-x-href="https://dom.spec.whatwg.org/#interface-node"><code>Node</code></dfn> interface</li>
2890
2895
<li><dfn data-x-href="https://dom.spec.whatwg.org/#interface-nodelist"><code>NodeList</code></dfn> interface</li>
@@ -2895,7 +2900,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
2895
2900
<li><dfn data-x-href="https://dom.spec.whatwg.org/#concept-node-document">node document</dfn> concept</li>
2896
2901
<li><dfn data-x="concept-document-type" data-x-href="https://dom.spec.whatwg.org/#concept-document-type">document type</dfn> concept</li>
2897
2902
<li><dfn data-x="concept-DocumentFragment-host" data-x-href="https://dom.spec.whatwg.org/#concept-documentfragment-host">host</dfn> concept</li>
2898
- <li>The <dfn data-x-href="https://dom.spec.whatwg.org/#concept-shadow-root">shadow root</dfn> concept, and its <dfn data-x-href="https://dom.spec.whatwg.org/#shadowroot-delegates-focus">delegates focus</dfn></li>
2903
+ <li>The <dfn data-x="concept-shadow-root" data-x -href="https://dom.spec.whatwg.org/#concept-shadow-root">shadow root</dfn> concept, and its <dfn data-x-href="https://dom.spec.whatwg.org/#shadowroot-delegates-focus">delegates focus</dfn></li>
2899
2904
<li>The <dfn data-x-href="https://dom.spec.whatwg.org/#element-shadow-host">shadow host</dfn> concept</li>
2900
2905
<li><dfn data-x-href="https://dom.spec.whatwg.org/#interface-htmlcollection"><code>HTMLCollection</code></dfn> interface, its
2901
2906
<dfn data-x="dom-HTMLCollection-length" data-x-href="https://dom.spec.whatwg.org/#dom-htmlcollection-length"><code>length</code></dfn> attribute, and its
@@ -14795,7 +14800,7 @@ interface <dfn>HTMLStyleElement</dfn> : <span>HTMLElement</span> {
14795
14800
<li><p>If <var>element</var> has an <span>associated CSS style sheet</span>, <span
14796
14801
data-x="remove a CSS style sheet">remove the CSS style sheet</span> in question.</p></li>
14797
14802
14798
- <li><p>If <var>element</var>'s <span>root</span> is neither a <span>shadow root</span> nor a
14803
+ <li><p>If <var>element</var>'s <span>root</span> is neither a <span data-x="concept-element-shadow-root" >shadow root</span> nor a
14799
14804
<span>document</span>, then return.</p></li>
14800
14805
<!-- https://software.hixie.ch/utilities/js/live-dom-viewer/?saved=2740
14801
14806
Also, per https://github.com/w3c/webcomponents/issues/56 stylesheets should work in
@@ -53852,7 +53857,7 @@ MIT Room 32-G524
53852
53857
<p>A user agent prefilling a form control must not discriminate between form controls that are
53853
53858
<span>in a document tree</span> and those that are <span>connected</span>; that is, it is not
53854
53859
conforming to make the decision on whether or not to autofill based on whether the element's
53855
- <span>root</span> is a <span>shadow root</span> versus a <code>Document</code>.</p>
53860
+ <span>root</span> is a <span data-x="concept-element-shadow-root" >shadow root</span> versus a <code>Document</code>.</p>
53856
53861
53857
53862
<p>A user agent prefilling a form control's <span data-x="concept-fe-value">value</span> must not
53858
53863
cause that control to <span data-x="suffering from a type mismatch">suffer from a type
@@ -57975,8 +57980,8 @@ o............A....e
57975
57980
set.</p></li>
57976
57981
57977
57982
<li>
57978
- <p>If <var>scriptElement</var>'s <span>root</span> is <em>not</em> a <span>shadow
57979
- root</span>, then set <var>document</var>'s <code
57983
+ <p>If <var>scriptElement</var>'s <span>root</span> is <em>not</em> a
57984
+ <span data-x="concept-element-shadow-root">shadow root</span>, then set <var>document</var>'s <code
57980
57985
data-x="dom-document-currentScript">currentScript</code> attribute to
57981
57986
<var>scriptElement</var>. Otherwise, set it to null.</p>
57982
57987
@@ -58467,7 +58472,8 @@ interface <dfn>HTMLTemplateElement</dfn> : <span>HTMLElement</span> {
58467
58472
[<span>HTMLConstructor</span>] constructor();
58468
58473
58469
58474
readonly attribute <span>DocumentFragment</span> <span data-x="dom-template-content">content</span>;
58470
- readonly attribute ShadowRoot? <span data-x="dom-template-shadowroot">shadowRoot</span>;
58475
+ readonly attribute <span data-x="concept-shadow-root">ShadowRoot</span>? <span data-x="dom-template-shadowroot">shadowRoot</span>;
58476
+
58471
58477
};</code></pre>
58472
58478
</dd>
58473
58479
<dd w-dev>Uses <code>HTMLTemplateElement</code>.</dd>
@@ -58617,16 +58623,23 @@ interface <dfn>HTMLTemplateElement</dfn> : <span>HTMLElement</span> {
58617
58623
</ol>
58618
58624
58619
58625
<p>The <dfn><code data-x="dom-template-content">content</code></dfn> IDL attribute must return the
58620
- <code>template</code> element's <span>template contents</span>. If the <code>template</code>'s
58621
- <a href="https://dom.spec.whatwg.org/#dom-is-declarative-shadow-root">is declarative shadow root</a>
58622
- property is true, then the <code data-x="dom-template-content">content</code> attribute must return
58623
- null instead.</p>
58626
+ result of running the <span>get template contents algorithm</span>.</p>
58624
58627
58625
58628
<p>The <dfn><code data-x="dom-template-shadowroot">shadowroot</code></dfn> IDL attribute must return
58626
- its base Element 's <a href="https:// dom.spec.whatwg.org/#dom -element-shadowroot">shadowroot</a> value .
58629
+ the value of the <code>template</code> element 's <span data-x=" dom-element-shadowroot">shadowRoot</span> attribute .
58627
58630
58628
58631
<hr>
58629
58632
58633
+ <p>The <dfn>get template contents algorithm</dfn>, which is passed a <var>template</var> (a
58634
+ <code>template</code> element) consists of running these steps:</p>
58635
+
58636
+ <ol>
58637
+ <li><p>If the <code>template</code>'s <span data-x="concept-is-declarative-shadow-root">is declarative shadow root</span>
58638
+ property is true, then return null.</p></li>
58639
+
58640
+ <li><p>Otherwise, return <code>template</code>'s <span>template contents</span>.</p></li>
58641
+ </ol>
58642
+
58630
58643
<p>The <span data-x="concept-node-clone-ext">cloning steps</span> for a <code>template</code>
58631
58644
element <var>node</var> being cloned to a copy <var>copy</var> must run the
58632
58645
following steps:</p>
@@ -65452,7 +65465,7 @@ console.log(plasticButton.outerHTML); // will output '<button is="plastic-but
65452
65465
is truly one-time will need a guard to prevent it from running twice.</p></li>
65453
65466
65454
65467
<li><p>In general, the constructor should be used to set up initial state and default values, and
65455
- to set up event listeners and possibly a <span>shadow root</span>.</p></li>
65468
+ to set up event listeners and possibly a <span data-x="concept-element-shadow-root" >shadow root</span>.</p></li>
65456
65469
</ul>
65457
65470
65458
65471
<p>Several of these requirements are checked during <span data-x="create an element">element
@@ -72160,7 +72173,7 @@ END:VCARD</pre>
72160
72173
<li><p>If <var>element</var>'s parent is a <span>shadow host</span>, then return
72161
72174
<var>element</var>'s <span>assigned slot</span>.</p></li>
72162
72175
72163
- <li><p>If <var>element</var>'s parent is a <span>shadow root</span>, then return the parent's
72176
+ <li><p>If <var>element</var>'s parent is a <span data-x="concept-element-shadow-root" >shadow root</span>, then return the parent's
72164
72177
<span data-x="concept-DocumentFragment-host">host</span>.</p></li>
72165
72178
72166
72179
<li><p>If <var>element</var>'s parent is the <span>document element</span>, then return the
@@ -106437,24 +106450,24 @@ document.body.appendChild(text);
106437
106450
106438
106451
<li><p>If the start tag for the <span data-x="concept-declarative-template-element">declarative template element</span> had an attribute with the name "shadowrootdelegatesfocus", then let <dfn><var data-x="concept-declarative-shadow-delegates-focus">declarative shadow delegates focus</var></dfn> be true. Otherwise let it be false.</p></li>
106439
106452
106440
- <li><p>Run <a href="https://dom.spec.whatwg.org/# concept-attach-a-shadow-root">attach a shadow root</a > with <var>shadow host</var>
106453
+ <li><p>Run <span data-x=" concept-attach-a-shadow-root">attach a shadow root</span > with <var>shadow host</var>
106441
106454
equal to <span data-x="concept-declarative-shadow-host-element">declarative shadow host element</span>,
106442
106455
<var>mode</var> equal to <span data-x="concept-declarative-shadow-mode">declarative shadow mode</span>, and
106443
106456
<span>delegates focus</span> equal to <span data-x="concept-declarative-shadow-delegates-focus">declarative shadow delegates focus</span>.</p></li>
106444
106457
106445
- <p>If an exception was thrown by <a href="https://dom.spec.whatwg.org/# concept-attach-a-shadow-root">attach a shadow root</a>,
106446
- catch it, and <span>report the exception</span> .</p>
106458
+ <p>If an exception was thrown by <span data-x=" concept-attach-a-shadow-root">attach a shadow root</span>, catch it.
106459
+ The exception may be reported to a developer console .</p>
106447
106460
106448
106461
<li><p>Otherwise, run these steps:</p>
106449
106462
106450
106463
<ol>
106464
+ <li><p>Set <span data-x="concept-declarative-shadow-host-element">declarative shadow host element</span>'s
106465
+ <span data-x="concept-element-shadow-root">shadow root</span>'s
106466
+ <span data-x="concept-is-declarative-shadow-root">is declarative shadow root</span> property to true.</p></li>
106451
106467
106452
- <li><p>Set <span data-x="concept-declarative-shadow-host-element">declarative shadow host element</span>'s <a href="https://dom.spec.whatwg.org/#concept-element-shadow-root">shadow host</a>'s
106453
- <a href="https://dom.spec.whatwg.org/#dom-is-declarative-shadow-root">is declarative shadow root</a> property to true.</p></li>
106454
-
106455
- <li><p><a href="https://dom.spec.whatwg.org/#concept-node-append">Append</a> the <span data-x="concept-declarative-template-element">declarative template element</span>'s DocumentFragment to the newly-created shadow root.</p></li>
106468
+ <li><p><span data-x="concept-node-append">Append</span> the <span data-x="concept-declarative-template-element">declarative template element</span>'s DocumentFragment to the newly-created shadow root.</p></li>
106456
106469
106457
- <li><p><a href="https://dom.spec.whatwg.org/# concept-node-remove">Remove</a > the <span data-x="concept-declarative-template-element">declarative template element</span> from the document.</p></li>
106470
+ <li><p><span data-x=" concept-node-remove">Remove</span > the <span data-x="concept-declarative-template-element">declarative template element</span> from the document.</p></li>
106458
106471
</ol>
106459
106472
</li>
106460
106473
@@ -109949,7 +109962,8 @@ document.body.appendChild(text);
109949
109962
<p>The following steps form the <!--en-GB--><dfn id="html-fragment-serialisation-algorithm"
109950
109963
data-export="">HTML fragment serialization algorithm</dfn>. The algorithm takes as input a DOM
109951
109964
<code>Element</code>, <code>Document</code>, or <code>DocumentFragment</code> referred to as
109952
- <var>the node</var>, and a boolean referred to as <var>include shadow roots</var> whose default value is false, and returns a string.</p>
109965
+ <var>the node</var>, a boolean referred to as <var>include shadow roots</var>, and a
109966
+ sequence<ShadowRoot> referred to as <var>closed shadow roots</var>, and returns a string.</p>
109953
109967
109954
109968
<p class="note">This algorithm serializes the <em>children</em> of the node being serialized, not
109955
109969
the node itself.</p>
@@ -110122,39 +110136,36 @@ document.body.appendChild(text);
110122
110136
true, then:
110123
110137
110124
110138
<ol>
110125
- <li><p>Append the literal string "<code data-x=""><template shadowroot="</code>" (U+003C LESS-THAN SIGN,
110126
- U+0074 LATIN SMALL LETTER T, U+0065 LATIN SMALL LETTER E, U+006D LATIN SMALL LETTER M,
110127
- U+0070 LATIN SMALL LETTER P, U+006C LATIN SMALL LETTER L, U+0061 LATIN SMALL LETTER A,
110128
- U+0074 LATIN SMALL LETTER T, U+0065 LATIN SMALL LETTER E, U+0020 SPACE,
110129
- U+0073 LATIN SMALL LETTER S, U+0068 LATIN SMALL LETTER H, U+0061 LATIN SMALL LETTER A,
110130
- U+0064 LATIN SMALL LETTER D, U+006F LATIN SMALL LETTER O, U+0077 LATIN SMALL LETTER W,
110131
- U+003D EQUALS SIGN, U+0022 QUOTATION MARK).</p></li>
110132
-
110133
- <li><p>If <var>shadow root</var>'s <a href="https://dom.spec.whatwg.org/#shadowroot-mode">mode</a>
110134
- is "open", then append the literal
110135
- string "<code data-x="">open</code>" (U+006F LATIN SMALL LETTER O, U+0070 LATIN SMALL LETTER P,
110136
- U+0065 LATIN SMALL LETTER E, U+006E LATIN SMALL LETTER N).</p></li>
110137
-
110138
- <li><p>If <var>shadow root</var>'s <a href="https://dom.spec.whatwg.org/#shadowroot-mode">mode</a>
110139
- is "closed", then append the literal
110140
- string "<code data-x="">closed</code>" (U+0063 LATIN SMALL LETTER C, U+006C LATIN SMALL LETTER L,
110141
- U+006F LATIN SMALL LETTER O, U+0073 LATIN SMALL LETTER S, U+0065 LATIN SMALL LETTER E,
110142
- U+0064 LATIN SMALL LETTER D).</p></li>
110143
-
110144
- <li><p>Append the literal string "<code data-x="">"></code>" (U+0022 QUOTATION MARK,
110145
- U+003E GREATER-THAN SIGN).</p></li>
110146
-
110147
- <li><p>Append the value of running the <span>HTML fragment serialization algorithm</span> on the
110148
- <var>shadow root</var> element (thus recursing into this algorithm for that
110149
- element).</p></li>
110150
-
110151
- <li><p>Append the literal string "<code data-x=""></template></code>" (U+003C LESS-THAN SIGN, U+002F SOLIDUS,
110152
- U+0074 LATIN SMALL LETTER T, U+0065 LATIN SMALL LETTER E, U+006D LATIN SMALL LETTER M,
110153
- U+0070 LATIN SMALL LETTER P, U+006C LATIN SMALL LETTER L, U+0061 LATIN SMALL LETTER A,
110154
- U+0074 LATIN SMALL LETTER T, U+0065 LATIN SMALL LETTER E, U+003E GREATER-THAN SIGN).</p></li>
110139
+ <li><p>Let <var>shadow root</var> be equal to <var>the node</var>'s <span data-x="concept-element-shadow-root">shadow root</span>.
110140
+
110141
+ <li><p>If <var>shadow root</var>'s <span data-x="concept-shadow-root-mode">mode</span>
110142
+ is "closed", and <var>shadow root</var> is <b>not</b> contained in <var>closed shadow roots</var>,
110143
+ then skip the next step.
110155
110144
110145
+ <li><p>Otherwise:
110146
+
110147
+ <ol>
110148
+ <li><p>Append the literal string "<code data-x=""><template shadowroot="</code>".</p></li>
110149
+
110150
+ <li><p>If <var>shadow root</var>'s <span data-x="concept-shadow-root-mode">mode</span>
110151
+ is "open", then append the literal
110152
+ string "<code data-x="">open</code>".</p></li>
110153
+
110154
+ <li><p>If <var>shadow root</var>'s <span data-x="concept-shadow-root-mode">mode</span>
110155
+ is "closed", then append the literal
110156
+ string "<code data-x="">closed</code>".</p></li>
110157
+
110158
+ <li><p>Append the literal string "<code data-x="">"></code>".</p></li>
110159
+
110160
+ <li><p>Append the value of running the <span>HTML fragment serialization algorithm</span> on the
110161
+ <var>shadow root</var> <code>DocumentFragment</code> (thus recursing into this algorithm for that
110162
+ element).</p></li>
110163
+
110164
+ <li><p>Append the literal string "<code data-x=""></template></code>".</p></li>
110165
+
110166
+ </ol>
110156
110167
</ol>
110157
- </li>
110168
+ </li>
110158
110169
110159
110170
<li><p>Return <var>s</var>.</p></li>
110160
110171
</ol>
0 commit comments