@@ -5329,8 +5329,8 @@ method steps are:
5329
5329
algorithm is passed <var> node</var> and <var> oldDocument</var> , as indicated in the <a>adopt</a>
5330
5330
algorithm.
5331
5331
5332
- <p> To <dfn export id=concept-node-adopt>adopt</dfn> a <var> node</var> into a <var> document</var> , run
5333
- these steps :
5332
+ <p> To <dfn export id=concept-node-adopt>adopt</dfn> a <var> node</var> into a <var> document</var> ,
5333
+ with an optional <var> forceDocumentFragmentAdoption </var> (default false) :
5334
5334
5335
5335
<ol>
5336
5336
<li><p> Let <var> oldDocument</var> be <var> node</var> 's <a for=Node>node document</a> .
@@ -5347,6 +5347,16 @@ these steps:
5347
5347
<a>shadow-including inclusive descendants</a> :
5348
5348
5349
5349
<ol>
5350
+ <li>
5351
+ <p> If <var> forceDocumentFragmentAdoption</var> is false, <var> inclusiveDescendant</var> is a
5352
+ {{DocumentFragment}} <a for=/>node</a> , <var> inclusiveDescendant</var> is <var> node</var> , and
5353
+ <var> node</var> 's <a for=DocumentFragment>host</a> is non-null, then
5354
+ <a for=iteration>continue</a> .
5355
+
5356
+ <p class=note> This is only reasonable as long as all <a>adopt</a> callers remove the children
5357
+ of <var> node</var> . HTML's <{template}> element passes true for
5358
+ <var> forceDocumentFragmentAdoption</var> .
5359
+
5350
5360
<li><p> Set <var> inclusiveDescendant</var> 's <a for=Node>node document</a> to <var> document</var> .
5351
5361
5352
5362
<li><p> If <var> inclusiveDescendant</var> is an <a for=/>element</a> , then set the
@@ -5375,6 +5385,12 @@ these steps:
5375
5385
<li><p> If <var> node</var> is a <a for=/>shadow root</a> , then <a>throw</a> a
5376
5386
"{{HierarchyRequestError!!exception}} " {{DOMException}} .
5377
5387
5388
+ <li>
5389
+ <p> If <var> node</var> is a {{DocumentFragment}} <a for=/>node</a> and its
5390
+ <a for=DocumentFragment>host</a> is non-null, then return <var> node</var> .
5391
+
5392
+ <p class=note> Unfortunately this does not throw for web compatibility.
5393
+
5378
5394
<li><p> <a>Adopt</a> <var> node</var> into <a>this</a> .
5379
5395
5380
5396
<li><p> Return <var> node</var> .
0 commit comments