Skip to content

Commit c825cea

Browse files
authored
Run adopt as part of insert
Also do not allow DocumentFragment nodes with host to be adopted. This means that a DocumentFragment is no longer implicitly adopted and a DocumentFragment with a (non-null) host cannot be put in a "weird" state. Tests: web-platform-tests/wpt#16348. Fixes #744.
1 parent c8462cb commit c825cea

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

dom.bs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2379,8 +2379,6 @@ of a <var>node</var> into a <var>parent</var> before a <var>child</var>, run the
23792379
<li><p>If <var>referenceChild</var> is <var>node</var>, then set <var>referenceChild</var> to
23802380
<var>node</var>'s <a for=tree>next sibling</a>.
23812381

2382-
<li><p><a>Adopt</a> <var>node</var> into <var>parent</var>'s <a for=Node>node document</a>.
2383-
23842382
<li><p><a for=/>Insert</a> <var>node</var> into <var>parent</var> before <var>referenceChild</var>.
23852383

23862384
<li><p>Return <var>node</var>.
@@ -2445,6 +2443,8 @@ before a <var>child</var>, with an optional <i>suppress observers flag</i>, run
24452443
<p>For each <var>node</var> in <var>nodes</var>, in <a>tree order</a>:
24462444

24472445
<ol>
2446+
<li><p><a>Adopt</a> <var>node</var> into <var>parent</var>'s <a for=Node>node document</a>.
2447+
24482448
<li><p>If <var>child</var> is null, then <a for=set>append</a> <var>node</var> to
24492449
<var>parent</var>'s <a for=tree>children</a>.
24502450

@@ -2557,8 +2557,6 @@ within a <var>parent</var>, run these steps:
25572557

25582558
<li><p>Let <var>previousSibling</var> be <var>child</var>'s <a>previous sibling</a>.
25592559

2560-
<li><p><a>Adopt</a> <var>node</var> into <var>parent</var>'s <a for=Node>node document</a>.
2561-
25622560
<li><p>Let <var>removedNodes</var> be the empty list.
25632561

25642562
<li>
@@ -2591,9 +2589,6 @@ within a <var>parent</var>, run these steps:
25912589
within a <var>parent</var>, run these steps:
25922590

25932591
<ol>
2594-
<li><p>If <var>node</var> is non-null, then <a>adopt</a> <var>node</var> into <var>parent</var>'s
2595-
<a for=Node>node document</a>.
2596-
25972592
<li><p>Let <var>removedNodes</var> be <var>parent</var>'s <a>children</a>.
25982593

25992594
<li><p>Let <var>addedNodes</var> be the empty list.
@@ -5308,16 +5303,18 @@ The <dfn method for=Document><code>adoptNode(<var>node</var>)</code></dfn> metho
53085303
must run these steps:
53095304

53105305
<ol>
5311-
<li>If <var>node</var> is a <a>document</a>, then <a>throw</a> a
5306+
<li><p>If <var>node</var> is a <a>document</a>, then <a>throw</a> a
53125307
"{{NotSupportedError!!exception}}" {{DOMException}}.
53135308

5314-
<li>If <var>node</var> is a <a for=/>shadow root</a>, then <a>throw</a> a
5309+
<li><p>If <var>node</var> is a <a for=/>shadow root</a>, then <a>throw</a> a
53155310
"{{HierarchyRequestError!!exception}}" {{DOMException}}.
53165311

5317-
<li><a>Adopt</a> <var>node</var>
5318-
into the <a>context object</a>.
5312+
<li><p>If <var>node</var> is a {{DocumentFragment}} <a for=/>node</a> whose
5313+
<a for=DocumentFragment>host</a> is non-null, then return.
5314+
5315+
<li><p><a>Adopt</a> <var>node</var> into the <a>context object</a>.
53195316

5320-
<li>Return <var>node</var>.
5317+
<li><p>Return <var>node</var>.
53215318
</ol>
53225319

53235320
<hr>

0 commit comments

Comments
 (0)