Skip to content

Commit

Permalink
and should throw when passed a ShadowRoot to fix #46
Browse files Browse the repository at this point in the history
  • Loading branch information
samgiles authored and annevk committed Jun 26, 2015
1 parent a00a03b commit 9d20dc5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 31 deletions.
28 changes: 13 additions & 15 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ urlPrefix: https://html.spec.whatwg.org/multipage/
text: effective script origin
text: origin alias; url: #concept-origin-alias
text: Unicode serialization of an origin
urlPrefix: https://w3c.github.io/webcomponents/spec/shadow/
type: dfn; urlPrefix: #dfn-
text: shadow root
url: http://www.w3.org/TR/DOM-Parsing/#widl-Range-createContextualFragment-DocumentFragment-DOMString-fragment
type: method; text: createContextualFragment(); for: Range;
type: interface
Expand Down Expand Up @@ -4635,31 +4638,25 @@ Note: No check is performed that <var>target</var> contains
<var>deep</var> is true, the copy also includes the
<var>node</var>'s <a>descendants</a>.

If <var>node</var> is a
<a>document</a> throws a
{{NotSupportedError}}
exception.
If <var>node</var> is a <a>document</a> or a <a>shadow root</a>, throws a
{{NotSupportedError}} exception.

<dt><var>node</var> = <var>document</var> . {{adoptNode(node)}}

<dd>
Moves <var>node</var> from another
<a>document</a> and returns it.

If <var>node</var> is a
<a>document</a> throws a
{{NotSupportedError}}
exception.
If <var>node</var> is a <a>document</a>, throws a {{NotSupportedError}} or, if
<var>node</var> is a <a>shadow root</a>, throws a {{HierarchyRequestError}} exception.
</dl>

The
<dfn method for="Document">importNode(<var>node</var>, <var>deep</var>)</dfn>
method must run these steps:

<ol>
<li>If <var>node</var> is a
<a>document</a>,
<a>throw</a> a
<li>If <var>node</var> is a <a>document</a> or <a>shadow root</a>, <a>throw</a> a
{{NotSupportedError}} exception.

<li>Return a <a lt="clone a node">clone</a> of
Expand Down Expand Up @@ -4700,10 +4697,11 @@ The
method must run these steps:

<ol>
<li>If <var>node</var> is a
<a>document</a>,
<a>throw</a> a
{{NotSupportedError}} exception.
<li>If <var>node</var> is a <a>document</a>, <a>throw</a> a {{NotSupportedError}}
exception.

<li>If <var>node</var> is a <a>shadow root</a>, <a>throw</a> a {{HierarchyRequestError}}
exception.

<li><a>Adopt</a> <var>node</var>
into the <a>context object</a>.
Expand Down
28 changes: 12 additions & 16 deletions dom.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<h1 class="p-name no-ref allcaps" id="title">DOM</h1>

<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Living Standard — Last Updated
<time class="dt-updated" datetime="2015-06-21">21 June 2015</time></span></h2>
<time class="dt-updated" datetime="2015-06-26">26 June 2015</time></span></h2>

<div data-fill-with="spec-metadata">
<dl>
Expand Down Expand Up @@ -6071,10 +6071,8 @@ <h3 class="heading settled" data-level="4.5" id="interface-document"><span class
<var>node</var>’s <a data-link-type="dfn" href="#concept-tree-descendant">descendants</a>.


<p>If <var>node</var> is a
<a data-link-type="dfn" href="#concept-document">document</a> throws a
<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code>
exception.</p>
<p>If <var>node</var> is a <a data-link-type="dfn" href="#concept-document">document</a> or a <a data-link-type="dfn" href="https://w3c.github.io/webcomponents/spec/shadow/#dfn-shadow-root">shadow root</a>, throws a
<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code> exception.</p>



Expand All @@ -6086,10 +6084,8 @@ <h3 class="heading settled" data-level="4.5" id="interface-document"><span class
<a data-link-type="dfn" href="#concept-document">document</a> and returns it.


<p>If <var>node</var> is a
<a data-link-type="dfn" href="#concept-document">document</a> throws a
<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code>
exception.</p>
<p>If <var>node</var> is a <a data-link-type="dfn" href="#concept-document">document</a>, throws a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code> or, if
<var>node</var> is a <a data-link-type="dfn" href="https://w3c.github.io/webcomponents/spec/shadow/#dfn-shadow-root">shadow root</a>, throws a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#hierarchyrequesterror">HierarchyRequestError</a></code> exception.</p>

</dl>

Expand All @@ -6101,9 +6097,7 @@ <h3 class="heading settled" data-level="4.5" id="interface-document"><span class

<ol>

<li>If <var>node</var> is a
<a data-link-type="dfn" href="#concept-document">document</a>,
<a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a
<li>If <var>node</var> is a <a data-link-type="dfn" href="#concept-document">document</a> or <a data-link-type="dfn" href="https://w3c.github.io/webcomponents/spec/shadow/#dfn-shadow-root">shadow root</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a
<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code> exception.


Expand Down Expand Up @@ -6155,10 +6149,12 @@ <h3 class="heading settled" data-level="4.5" id="interface-document"><span class

<ol>

<li>If <var>node</var> is a
<a data-link-type="dfn" href="#concept-document">document</a>,
<a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a
<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code> exception.
<li>If <var>node</var> is a <a data-link-type="dfn" href="#concept-document">document</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code>
exception.


<li>If <var>node</var> is a <a data-link-type="dfn" href="https://w3c.github.io/webcomponents/spec/shadow/#dfn-shadow-root">shadow root</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#hierarchyrequesterror">HierarchyRequestError</a></code>
exception.


<li><a data-link-type="dfn" href="#concept-node-adopt">Adopt</a> <var>node</var>
Expand Down

0 comments on commit 9d20dc5

Please sign in to comment.