Re: [whatwg/dom] Editorial: Specify `ParentNode.replaceChildren` implementation. (#835)

annevk commented on this pull request.

I'm not sure why you marked this as an editorial change?

Given

> This algorithm does not make any checks with regards to the node tree constraints. Specification authors need to use it wisely. 

I think I've spotted at least one blocking issue. If after the first step node is not a node you can append to a DocumentFragment, we need to throw. (Probably the HierarchyRequestError the dominfo block already mentions.)

> @@ -2879,6 +2889,16 @@ must run these steps:
  <li><p><a>Append</a> <var>node</var> to <a>this</a>.
 </ol>
 
+<p>The <dfn method for=ParentNode><code>replaceChildren(<var>nodes</var>)</code></dfn> method, when invoked,
+must run these steps:
+
+<ol>
+ <li><p>Let <var>node</var> be the result of <a>converting nodes into a node</a> given
+ <var>nodes</var> and <a>this</a>'s <a for=Node>node document</a>.
+
+ <li><a for=Node>Replace all</a> <a>children</a> of <a>this</a> with <var>node</var>.

```suggestion
 <li><p><a for=Node>Replace all</a> <a>children</a> of <a>this</a> with <var>node</var>.
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/835#pullrequestreview-359843837

Received on Monday, 17 February 2020 16:13:27 UTC