Skip to content

Commit aa52274

Browse files
authored
Correct <template>.content getter steps
Also address some variable naming issues nearby. Fixes #11953.
1 parent 7da45df commit aa52274

File tree

1 file changed

+27
-20
lines changed

1 file changed

+27
-20
lines changed

source

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -68013,11 +68013,11 @@ interface <dfn interface>HTMLTemplateElement</dfn> : <span>HTMLElement</span> {
6801368013
contents</span>:</p>
6801468014

6801568015
<ol>
68016-
<li><p>Let <var>doc</var> be the <code>template</code> element's <span>node document</span>'s <span>appropriate template contents owner
68017-
document</span>.</p></li>
68016+
<li><p>Let <var>document</var> be the <code>template</code> element's <span>node
68017+
document</span>'s <span>appropriate template contents owner document</span>.</p></li>
6801868018

6801968019
<li><p>Create a <code>DocumentFragment</code> object whose <span>node document</span> is
68020-
<var>doc</var> and <span data-x="concept-DocumentFragment-host">host</span> is the
68020+
<var>document</var> and <span data-x="concept-DocumentFragment-host">host</span> is the
6802168021
<code>template</code> element.</p></li>
6802268022

6802368023
<li><p>Set the <code>template</code> element's <span>template contents</span> to the newly
@@ -68026,33 +68026,34 @@ interface <dfn interface>HTMLTemplateElement</dfn> : <span>HTMLElement</span> {
6802668026
</div>
6802768027

6802868028
<div algorithm>
68029-
<p>A <code>Document</code> <var>doc</var>'s <dfn>appropriate template contents owner
68029+
<p>A <code>Document</code> <var>document</var>'s <dfn>appropriate template contents owner
6803068030
document</dfn> is the <code>Document</code> returned by the following algorithm:</p>
6803168031

6803268032
<ol>
6803368033
<li>
68034-
<p>If <var>doc</var> is not a <code>Document</code> created by this algorithm, then:</p>
68034+
<p>If <var>document</var> is not a <code>Document</code> created by this algorithm:</p>
6803568035

6803668036
<ol>
6803768037
<li>
68038-
<p>If <var>doc</var> does not yet have an <dfn>associated inert template document</dfn>,
68039-
then:</p>
68038+
<p>If <var>document</var> does not yet have an <dfn>associated inert template
68039+
document</dfn>:</p>
6804068040

6804168041
<ol>
68042-
<li><p>Let <var>new doc</var> be a new <code>Document</code> (whose <span
68042+
<li><p>Let <var>newDocument</var> be a new <code>Document</code> (whose <span
6804368043
data-x="concept-document-bc">browsing context</span> is null). This is "a
6804468044
<code>Document</code> created by this algorithm" for the purposes of the step above.</p></li>
6804568045

68046-
<li><p>If <var>doc</var> is an <span data-x="HTML documents">HTML document</span>, mark
68047-
<var>new doc</var> as an <span data-x="HTML documents">HTML document</span>
68046+
<li><p>If <var>document</var> is an <span data-x="HTML documents">HTML document</span>, then
68047+
mark <var>newDocument</var> as an <span data-x="HTML documents">HTML document</span>
6804868048
also.</p></li>
6804968049

68050-
<li><p>Set <var>doc</var>'s <span>associated inert template document</span> to <var>new doc</var>.</p></li>
68050+
<li><p>Set <var>document</var>'s <span>associated inert template document</span> to
68051+
<var>newDocument</var>.</p></li>
6805168052
</ol>
6805268053
</li>
6805368054

68054-
<li><p>Set <var>doc</var> to <var>doc</var>'s <span>associated inert
68055-
template document</span>.</p></li>
68055+
<li><p>Set <var>document</var> to <var>document</var>'s <span>associated inert template
68056+
document</span>.</p></li>
6805668057
</ol>
6805768058

6805868059
<p class="note">Each <code>Document</code> not created by this algorithm thus gets a single
@@ -68063,7 +68064,7 @@ interface <dfn interface>HTMLTemplateElement</dfn> : <span>HTMLElement</span> {
6806368064
<code>Document</code> owner for their contents.</p>
6806468065
</li>
6806568066

68066-
<li><p>Return <var>doc</var>.</p></li>
68067+
<li><p>Return <var>document</var>.</p></li>
6806768068
</ol>
6806868069
</div>
6806968070

@@ -68074,23 +68075,29 @@ interface <dfn interface>HTMLTemplateElement</dfn> : <span>HTMLElement</span> {
6807468075

6807568076
<ol>
6807668077
<li>
68077-
<p>Let <var>doc</var> be <var>node</var>'s <span>node document</span>'s
68078+
<p>Let <var>document</var> be <var>node</var>'s <span>node document</span>'s
6807868079
<span>appropriate template contents owner document</span>.</p>
6807968080

6808068081
<p class="note"><var>node</var>'s <span>node document</span> is the <code>Document</code> object
6808168082
that <var>node</var> was just adopted <em>into</em>.</p>
6808268083
</li>
6808368084

6808468085
<li><p><span data-x="concept-node-adopt">Adopt</span> <var>node</var>'s
68085-
<span>template contents</span> (a <code>DocumentFragment</code> object) into <var>doc</var>.</p></li>
68086+
<span>template contents</span> (a <code>DocumentFragment</code> object) into
68087+
<var>document</var>.</p></li>
6808668088
</ol>
6808768089
</div>
6808868090

6808968091
<div algorithm>
6809068092
<p>The <dfn attribute for="HTMLTemplateElement"><code
68091-
data-x="dom-template-content">content</code></dfn> getter steps are to return
68092-
<code>template</code>'s <span>template contents</span>, if the <span>template contents</span> is
68093-
not a <code>ShadowRoot</code> node; otherwise null.</p>
68093+
data-x="dom-template-content">content</code></dfn> getter steps are:
68094+
68095+
<ol>
68096+
<li><p><span>Assert</span>: <span>this</span>'s <span>template contents</span> is not a
68097+
<code>ShadowRoot</code> node.</p></li>
68098+
68099+
<li><p>Return <span>this</span>'s <span>template contents</span>.</p></li>
68100+
</ol>
6809468101
</div>
6809568102

6809668103
<div algorithm>
@@ -140369,7 +140376,7 @@ document.body.appendChild(text);
140369140376
<li><p>Set <var>shadow</var>'s <span
140370140377
data-x="concept-shadow-root-declarative">declarative</span> to true.</p></li>
140371140378

140372-
<li><p>Set <var>template</var>'s <span>template contents</span> property to
140379+
<li><p>Set <var>template</var>'s <span>template contents</span> to
140373140380
<var>shadow</var>.</p></li>
140374140381

140375140382
<li><p>Set <var>shadow</var>'s <span>available to element internals</span> to

0 commit comments

Comments
 (0)