Skip to content

Commit

Permalink
add initializeSubtree and make innerHTML work
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed Dec 18, 2024
1 parent 2c69d78 commit e3431e0
Showing 1 changed file with 46 additions and 9 deletions.
55 changes: 46 additions & 9 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -72713,6 +72713,7 @@ interface <dfn interface>CustomElementRegistry</dfn> {

[<span>CEReactions</span>, NewObject] <span>HTMLElement</span> <span data-x="dom-CustomElementRegistry-createElement">createElement</span>(DOMString <var>name</var>);
[<span>CEReactions</span>, NewObject] <span>Node</span> <span data-x="dom-CustomElementRegistry-cloneSubtree">cloneSubtree</span>(<span>Node</span> <var>root</var>);
undefined <span data-x="dom-CustomElementRegistry-initializeSubtree">initializeSubtree</span>((<span>Element</span> or <span>ShadowRoot</span>) <var>root</var>);
};

callback <dfn callback>CustomElementConstructor</dfn> = <span>HTMLElement</span> ();
Expand Down Expand Up @@ -72816,7 +72817,11 @@ dictionary <dfn dictionary>ElementDefinitionOptions</dfn> {

<dt><code data-x=""><var>registry</var>.<span subdfn data-x="dom-CustomElementRegistry-cloneSubtree">cloneSubtree</span>(<var>root</var>)</code></dt>
<dd>Returns a copy of <var>root</var>, changing the registry from <var>root</var>'s inclusive
descendants from null (if any) to <var>registry</var> in the process.
descendants from null (if any) to <var>registry</var> in the process.</dd>

<dt><code data-x=""><var>registry</var>.<span subdfn data-x="dom-CustomElementRegistry-initializeSubtree">initializeSubtree</span>(<var>root</var>)</code></dt>
<dd>Each <span>inclusive descendant</span> of <var>root</var> with a null registry will have it
updated to this <code>CustomElementRegistry</code> object.</dd>
</dl>

<p w-nodev>The <dfn
Expand Down Expand Up @@ -73173,10 +73178,40 @@ console.assert(el instanceof SpiderMan); // upgraded!</code></pre>

<p>The <dfn method for="CustomElementRegistry"><code
data-x="dom-CustomElementRegistry-cloneSubtree">cloneSubtree(<var>root</var>)</code></dfn>
method steps are to return the result of <span data-x="concept-node-clone">cloning a node</span>
given <var>root</var> with <span data-x="concept-node-clone-subtree"><i>subtree</i></span> set to
true and <span data-x="concept-node-clone-fallbackRegistry"><i>fallbackRegistry</i></span> set
<span>this</span>.</p>
method steps are:</p>

<ol>
<li><p>If <var>root</var> is a <code>Document</code> or <code>ShadowRoot</code> object, then
throw a <span>"<code>NotSupportedError</code>"</span> <code>DOMException</code>.</p></li>

<li><p>Return the result of <span data-x="concept-node-clone">cloning a node</span> given
<var>root</var> with <span data-x="concept-node-clone-subtree"><i>subtree</i></span> set to true
and <span data-x="concept-node-clone-fallbackRegistry"><i>fallbackRegistry</i></span> set
<span>this</span>.</p></li>
</ol>

<p>The <dfn method for="CustomElementRegistry"><code
data-x="dom-CustomElementRegistry-initializeSubtree">initializeSubtree(<var>root</var>)</code></dfn>
method steps are:</p>

<ol>
<li>
<p>For each <span>inclusive descendant</span> <var>inclusiveDescendant</var> of
<var>root</var>:</p>

<ol>
<li><p>If <var>inclusiveDescendant</var> is an <code>Element</code> node whose <span
data-x="element-custom-element-registry">custom element registry</span> is null, then set
<var>inclusiveDescendant</var>'s <span data-x="element-custom-element-registry">custom element
registry</span> to <span>this</span>.</p></li>

<li><p>Otherwise, if <var>inclusiveDescendant</var> is a <code>ShadowRoot</code> node whose
<span data-x="shadow-root-custom-element-registry">custom element registry</span> is null, set
<var>inclusiveDescendant</var>'s <span data-x="shadow-root-custom-element-registry">custom
element registry</span> to <span>this</span>.</p></li>
</ol>
</li>
</ol>


<h4><dfn data-x="custom-element-upgrades">Upgrades</dfn></h4>
Expand Down Expand Up @@ -129333,7 +129368,8 @@ dictionary <dfn dictionary>StorageEventInit</dfn> : <span>EventInit</span> {
<li><p>Let <var>is</var> be the value of the "<code data-x="attr-is">is</code>" attribute in the
given token, if such an attribute exists, or null otherwise.</p></li>

<li class="XXX"><p>Obtain <var>registry</var> from the parser context.</p></li>
<li><p>Let <var>registry</var> be the result of <span data-x="look up a custom element
registry">looking up a custom element registry</span> given <var>intended parent</var>.</p></li>

<li><p>Let <var>definition</var> be the result of <span data-x="look up a custom element
definition">looking up a custom element definition</span> given <var>registry</var>, <var>given
Expand Down Expand Up @@ -134512,9 +134548,10 @@ console.assert(container.firstChild instanceof SuperP);
transitions.</p>
</li>

<li>
<p>Let <var>root</var> be a new <code>html</code> element with no attributes.</p>
</li>
<li><p>Let <var>root</var> be the result of <span>creating an element</span> given the
<code>Document</code> node created above, "<code data-x="">html</code>", the <span>HTML
namespace</span>, null, null, false, and <var>context</var>'s <span
data-x="element-custom-element-registry">custom element registry</span>.</p></li>

<li>
<p>Append the element <var>root</var> to the <code>Document</code> node created
Expand Down

0 comments on commit e3431e0

Please sign in to comment.