Skip to content

Commit 7fbc19e

Browse files
saschanazannevk
authored andcommitted
Add innerHTML to ShadowRoot
Fixes #21.
1 parent ab8d1ac commit 7fbc19e

File tree

1 file changed

+32
-11
lines changed

1 file changed

+32
-11
lines changed

index.html

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ <h2>Extensibility</h2>
293293

294294
<pre class="idl">
295295
[Constructor, Exposed=Window]
296-
interface XMLSerializer {
296+
interface XMLSerializer {
297297
DOMString serializeToString(Node root);
298298
};
299299
</pre>
@@ -316,29 +316,30 @@ <h2>Extensibility</h2>
316316

317317
</section><!-- end XMLSerializer interface -->
318318

319-
<section><h2>Extensions to the <code><a>Element</a></code> interface</h2>
319+
<section><h2>The <dfn>InnerHTML</dfn> mixin</h2>
320320

321321
<pre class="idl">
322-
partial interface Element {
322+
interface mixin InnerHTML {
323323
[CEReactions, TreatNullAs=EmptyString] attribute DOMString innerHTML;
324-
[CEReactions, TreatNullAs=EmptyString] attribute DOMString outerHTML;
325-
[CEReactions] void insertAdjacentHTML(DOMString position, DOMString text);
326324
};
325+
326+
Element includes InnerHTML;
327+
ShadowRoot includes InnerHTML;
327328
</pre>
328329

329330
<!-- innerHTML -->
330331

331-
<p>The <dfn data-dfn-for="Element"><code>innerHTML</code></dfn> IDL attribute represents the markup of the
332-
<code><a>Element</a></code>'s contents.
332+
<p>The <dfn data-dfn-for="InnerHTML"><code>innerHTML</code></dfn> IDL attribute represents the markup of the
333+
element's contents.
333334

334335
<dl class=domintro>
335-
<dt><var>element</var> . <a data-link-for="Element">innerHTML</a> [ = <var>value</var> ]
336+
<dt><var>element</var> . <a data-link-for="InnerHTML">innerHTML</a> [ = <var>value</var> ]
336337
<dd>Returns a fragment of HTML or XML that represents the element's contents.
337338

338339
<p>Can be set, to replace the contents of the element with nodes parsed from the given string.
339340

340341
<p>In the case of an <a>XML document</a>, throws a "<code><a>InvalidStateError</a></code>"
341-
<code><a>DOMException</a></code> if the <code><a>Element</a></code> cannot be serialized to XML,
342+
<code><a>DOMException</a></code> if the element cannot be serialized to XML,
342343
or a "<code><a>SyntaxError</a></code>" <code><a>DOMException</a></code> if the given string is
343344
not well-formed.
344345
</dl>
@@ -350,9 +351,12 @@ <h2>Extensibility</h2>
350351
<p>On setting, these steps must be run:
351352

352353
<ol>
354+
<li>Let <var>context element</var> be the <a>context object</a>'s
355+
<a data-cite="DOM#concept-documentfragment-host">host</a> if the <a>context object</a> is a
356+
<a>ShadowRoot</a> object, or the <a>context object</a> otherwise.
357+
353358
<li>Let <var>fragment</var> be the result of invoking the <a>fragment parsing algorithm</a> with
354-
the new value as <var>markup</var>, and the <a>context object</a> as the
355-
<var>context element</var>.
359+
the new value as <var>markup</var>, and with <var>context element</var>.
356360

357361
<li>If the <a>context object</a> is a <code><a>template</a></code> element, then let
358362
<a>context object</a> be the <code><a>template</a></code>'s <a>template contents</a> (a
@@ -365,6 +369,17 @@ <h2>Extensibility</h2>
365369
<li><a>Replace all</a> with <var>fragment</var> within the <a>context object</a>.
366370
</ol>
367371

372+
</section><!-- end InnerHTML mixin -->
373+
374+
<section><h2>Extensions to the <code><a>Element</a></code> interface</h2>
375+
376+
<pre class="idl">
377+
partial interface Element {
378+
[CEReactions, TreatNullAs=EmptyString] attribute DOMString outerHTML;
379+
[CEReactions] void insertAdjacentHTML(DOMString position, DOMString text);
380+
};
381+
</pre>
382+
368383
<!-- outerHTML -->
369384

370385
<p>The <dfn data-dfn-for="Element"><code>outerHTML</code></dfn> IDL attribute represents the markup of the
@@ -1790,6 +1805,12 @@ <h2>Dependencies</h2>
17901805
"<dfn><a href="https://www.w3.org/TR/dom/#syntaxerror">SyntaxError</a></dfn>",
17911806
<li><dfn><a href="https://www.w3.org/TR/dom/#xmldocument">XMLDocument</a></dfn>
17921807
</ul>
1808+
1809+
The following terms used in this document are defined by [[DOM]]:
1810+
1811+
<ul>
1812+
<li>The <dfn data-cite="DOM#shadowroot">ShadowRoot</dfn> interface
1813+
</ul>
17931814

17941815
The following terms used in this document are defined by [[XML10]]:
17951816

0 commit comments

Comments
 (0)