Skip to content

Commit

Permalink
add to shadowroot
Browse files Browse the repository at this point in the history
  • Loading branch information
josepharhar committed Aug 24, 2023
1 parent d522f14 commit b3e163e
Showing 1 changed file with 35 additions and 7 deletions.
42 changes: 35 additions & 7 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -10668,6 +10668,20 @@ partial interface <dfn id="document" data-lt="">Document</dfn> {
readonly attribute <span>Element</span>? <span data-x="dom-documentorshadowroot-activeElement">activeElement</span>;
};</code></pre>

<h4>The <code>ShadowRoot</code> interface</h4>

<p><cite>DOM</cite> defines the <code>ShadowRoot</code> interface, which this specification
extends.</p>

<pre><code class="idl">partial interface <span id="ShadowRoot-partial">ShadowRoot</span> {
undefined <span data-x="dom-ShadowRoot-setHTMLUnsafe">setHTMLUnsafe</span>(DOMString string);
};</code></pre>

<p>The <dfn method for="ShadowRoot"><code
data-x="dom-ShadowRoot-setHTMLUnsafe">setHTMLUnsafe(<var>string</var>)</code></dfn> method steps
are to run the <span>unsafe set HTML</span> steps given <span>this</span>, <span>this</span>'s
<span>shadow host</span>, and <var>string</var>.</p>

<h4><dfn>Resource metadata management</dfn></h4>

<dl class="domintro">
Expand Down Expand Up @@ -109017,13 +109031,21 @@ enum <dfn enum>DOMParserSupportedType</dfn> {

<dl class="domintro">
<dt><code data-x=""><var>element</var>.<span subdfn
data-x="dom-setHTMLUnsafe">setHTMLUnsafe</span>(<var>string</var>)</code></dt>
data-x="dom-Element-setHTMLUnsafe">setHTMLUnsafe</span>(<var>string</var>)</code></dt>

<dd>
<p>Parses <var>string</var> using the HTML parser, and replaces the children of
<var>element</var> with the result.</p>
</dd>

<dt><code data-x=""><var>shadowRoot</var>.<span subdfn
data-x="dom-ShadowRoot-setHTMLUnsafe">setHTMLUnsafe</span>(<var>string</var>)</code></dt>

<dd>
<p>Parses <var>string</var> using the HTML parser, and replaces the children of
<var>shadowRoot</var> with the result.</p>
</dd>

<dt><code data-x=""><var>doc</var> = Document.<span
data-x="dom-parseHTMLUnsafe">parseHTMLUnsafe</span>(<var>string</var>)</code></dt>

Expand All @@ -109037,24 +109059,30 @@ enum <dfn enum>DOMParserSupportedType</dfn> {
attributes like <code>script</code> or <span>event handler content attributes</span>.</p>

<pre><code class="idl">partial interface <span id="Element-partial">Element</span> {
undefined <span data-x="dom-setHTMLUnsafe">setHTMLUnsafe</span>(DOMString string);
undefined <span data-x="dom-Element-setHTMLUnsafe">setHTMLUnsafe</span>(DOMString string);
};</code></pre>

<p>The <dfn method for="Element"><code
data-x="dom-setHTMLUnsafe">setHTMLUnsafe(<var>string</var>)</code></dfn> method steps are:</p>
data-x="dom-Element-setHTMLUnsafe">setHTMLUnsafe(<var>string</var>)</code></dfn> method steps are
to run the <span>unsafe set HTML</span> steps given <span>this</span>, <span>this</span>, and
<var>string</var>.</p>

<p>To <dfn>unsafe set HTML</dfn>, given an <code>Element</code> or <code>ShadowRoot</code>
<var>container</var>, an <code>Element</code> <var>contextElement</var>, and a <span>string</span>
<var>string</var>:</p>

<ol>
<li><p>Let <var>newChildren</var> be the result of the <span>HTML fragment parsing algorithm</span>
given <span>this</span> and <var>string</var>.</p></li>
given <var>contextElement</var> and <var>string</var>.</p></li>

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

<li><p>For each <var>node</var> in <var>newChildren</var>, <span
data-x="concept-node-append">append</span> <var>node</var> to <var>fragment</var>.</p></li>

<li><p>Let <var>target</var> be <span>this</span>'s <span>template contents</span> if
<span>this</span> is a <code>template</code> element; otherwise <span>this</span>.</p></li>
<li><p>Let <var>target</var> be <var>container</var>'s <span>template contents</span> if
<var>container</var> is a <code>template</code> element; otherwise <var>container</var>.</p></li>

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

0 comments on commit b3e163e

Please sign in to comment.