Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewarlow committed Apr 11, 2024
1 parent a5a03fb commit ea4caba
Showing 1 changed file with 50 additions and 39 deletions.
89 changes: 50 additions & 39 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -112384,12 +112384,14 @@ document.body.appendChild(frame)</code></pre>
<pre><code class="idl">partial interface <span id="Element-partial">Element</span> {
[<span>CEReactions</span>] undefined <span data-x="dom-Element-setHTMLUnsafe">setHTMLUnsafe</span>(<span data-x="tt-htmlstring">HTMLString</span> html);
DOMString <span data-x="dom-Element-getHTML">getHTML</span>(optional <span>GetHTMLOptions</span> options = {});

[<span>CEReactions</span>] attribute [<span>LegacyNullToEmptyString</span>] <span data-x="tt-htmlstring">HTMLString</span> <span data-x="dom-Element-innerHTML">innerHTML</span>;
};

partial interface <span id="ShadowRoot-partial">ShadowRoot</span> {
[<span>CEReactions</span>] undefined <span data-x="dom-ShadowRoot-setHTMLUnsafe">setHTMLUnsafe</span>(<span data-x="tt-htmlstring">HTMLString</span> html);
DOMString <span data-x="dom-ShadowRoot-getHTML">getHTML</span>(optional <span>GetHTMLOptions</span> options = {});

[<span>CEReactions</span>] attribute [<span>LegacyNullToEmptyString</span>] <span data-x="tt-htmlstring">HTMLString</span> <span data-x="dom-ShadowRoot-innerHTML">innerHTML</span>;
};

Expand Down Expand Up @@ -112722,85 +112724,94 @@ enum <dfn enum>DOMParserSupportedType</dfn> {

<div w-nodev>

<p>The <dfn export>fragment serializing algorithm steps</dfn>, given a DOM <span>Element</span>
or <span>DocumentFragment</span> referred to as <var>node</var> and a flag <dfn>require
well-formed</dfn>, are:</p>
<p>The <dfn export>fragment serializing algorithm steps</dfn>, given an <code>Element</code> or
<code>DocumentFragment</code> <var>node</var> and a boolean <var>require well-formed</var>,
are:</p>

<ol>
<li><p>Let <var>context document</var> be the value of <var>node</var>'s <span>node
<li><p>Let <var>context document</var> be the <var>node</var>'s <span>node
document</span>.</p></li>

<li><p>If <var>context document</var> is an <span data-x="HTML documents">HTML document</span>,
return the result of <span>HTML fragment serialization algorithm</span> with <var>node</var>,
false, and « ».</p></li>

<li><p>Otherwise, <var>context document</var> is an <span data-x="XML documents">XML
document</span>; return an <span data-x="xml-serialization">XML serialization</span> of
<var>node</var> passing the flag <var>require well-formed</var>.</p></li>
document</span>; return the <span data-x="xml-serialization">XML serialization</span> of
<var>node</var> given <var>require well-formed</var>.</p></li>
</ol>

<p>The <dfn export>fragment parsing algorithm steps</dfn>, given a DOM <span>Element</span> or
<span>DocumentFragment</span> referred to as <var>context element</var> and string
<var>markup</var>, are:</p>
<p>The <dfn export>fragment parsing algorithm steps</dfn>, given an <code>Element</code> or
<code>DocumentFragment</code> <var>context element</var> and a string <var>markup</var>, are:</p>

<ol>
<li><p>If the <var>context element</var>'s <span>node document</span> is an <span data-x="HTML
documents">HTML document</span>: let <var>algorithm</var> be the <span>HTML fragment parsing
algorithm</span>.</p></li>
<li><p>Let <var>algorithm</var> be the <span>HTML fragment parsing algorithm</span>.</p></li>

<li><p>If the <var>context element</var>'s <span>node document</span> is an <span data-x="XML
documents">XML document</span>: let <var>algorithm</var> be the <span>XML fragment parsing
<li><p>If <var>context element</var>'s <span>node document</span> is an <span data-x="XML
documents">XML document</span>: set <var>algorithm</var> to the <span>XML fragment parsing
algorithm</span>.</p></li>

<li><p>Let <var>new children</var> be the result of invoking <var>algorithm</var> with
<var>markup</var> as the <var>input</var>, and <var>context element</var> as the <var
data-x="concept-frag-parse-context">context</var> element.</p></li>
<li><p>Let <var>new children</var> be the result of invoking <var>algorithm</var> given
<var>markup</var>, with <var data-x="concept-frag-parse-context">context</var> set to the
<var>context element</var>.</p></li>

<li><p>Let <var>fragment</var> be a new <span>DocumentFragment</span> whose <span>node
<li><p>Let <var>fragment</var> be a new <code>DocumentFragment</code> whose <span>node
document</span> is <var>context element</var>'s <span>node document</span>.</p></li>

<li>
<p><span data-x="concept-node-append">Append</span> each <span>Node</span> in <var>new
<p><span data-x="concept-node-append">Append</span> each <code>Node</code> in <var>new
children</var> to <var>fragment</var> (in <span>tree order</span>).</p>

<p class=note>This ensures the <span>node document</span> for the new <span
data-x="node">nodes</span> is correct.</p>
</li>

<li><p>Return the value of <var>fragment</var>.</p></li>
<li><p>Return <var>fragment</var>.</p></li>
</ol>

<p>The <dfn attribute for="Element"><code
data-x="dom-Element-innerHTML">element.innerHTML</code></dfn> and <dfn attribute
for="ShadowRoot"><code data-x="dom-ShadowRoot-innerHTML">shadowRoot.innerHTML</code></dfn> getter
steps are to return the result of running <span>fragment serializing algorithm steps</span> with
<span>this</span>, and true.</p>
<p><code>Element</code>'s <dfn attribute for="Element"><code
data-x="dom-Element-innerHTML">innerHTML</code></dfn> getter steps are to return the result of
running <span>fragment serializing algorithm steps</span> with <span>this</span> and true.</p>

<p>The <code data-x="dom-Element-innerHTML">element.innerHTML</code> and <code
data-x="dom-ShadowRoot-innerHTML">shadowRoot.innerHTML</code> setters steps are:</p>
<p><code>ShadowRoot</code>'s <dfn attribute for="ShadowRoot"><code
data-x="dom-ShadowRoot-innerHTML">innerHTML</code></dfn> getter steps are to return the result of
running <span>fragment serializing algorithm steps</span> with <span>this</span> and true.</p>

<p><code>Element</code>'s <code data-x="dom-Element-innerHTML">innerHTML</code> setter steps
are:</p>

<ol>
<li><p>Let <var>context object</var> be <span>this</span>.</p></li>
<li><p>Let <var>context element</var> be the <var>context object</var>'s <span
data-x="concept-DocumentFragment-host">host</span> if <var>this</var> is a
<span>ShadowRoot</span> object, or <var>this</var> otherwise.</p></li>

<li><p>Let <var>fragment</var> be the result of invoking the <span>fragment parsing algorithm
steps</span> with <var>context element</var>, and the given value.</p></li>
steps</span> with <var>context object</var>, and the given value.</p></li>

<li>
<p>If <var>context object</var> is a <span>template</span> element, then let <var>context
object</var> be the <span>template</span> element's <span>template contents</span> (a
<span>DocumentFragment</span>).</p>
<p>If <var>context object</var> is a <code>template</code> element, then let <var>context
object</var> be the <code>template</code> element's <span>template contents</span> (a
<code>DocumentFragment</code>).</p>

<p class=note>Setting <code data-x="dom-Element-innerHTML">innerHTML</code> on a
<span>template</span> element will replace all the nodes in its <span>template contents</span>
(<span>template</span>.<span data-x="template contents">contents</span>) rather than its <span
data-x="concept-tree-child">children</span>.</p>
<code>template</code> element will replace all the nodes in its <span>template contents</span>
rather than its <span data-x="concept-tree-child">children</span>.</p>
</li>

<li><p><span data-x="concept-node-replace-all">Replace all</span> with <var>fragment</var> within
<var>context object</var>.</p></li>
<li><p><span data-x="concept-node-replace-all">Replace all</span> with <var>fragment</var>
within <var>context object</var>.</p></li>
</ol>

<p><code>ShadowRoot</code>'s <code data-x="dom-ShadowRoot-innerHTML">innerHTML</code> setter
steps are:</p>

<ol>
<li><p>Let <var>context element</var> be <span>this</span>'s <span
data-x="concept-DocumentFragment-host">host</span>.</p></li>

<li><p>Let <var>fragment</var> be the result of invoking the <span>fragment parsing algorithm
steps</span> with <var>context element</var> and the given value.</p></li>

<li><p><span data-x="concept-node-replace-all">Replace all</span> with <var>fragment</var>
within <span>this</span>.</p></li>
</ol>

</div>
Expand Down

0 comments on commit ea4caba

Please sign in to comment.