Re: [whatwg/dom] prepend/append are inefficient compared to doing it yourself (#433)

Maybe because this new methods (prepend/append/before/after/replaceWith) operate on multiple arguments and using fragment is easiest to modify the tree in the next steps. All of them [using convert nodes into a node](https://dom.spec.whatwg.org/#converting-nodes-into-a-node) and for multiple nodes can leake this #document-fragment as parent (when conversion faild like above example).

But fragment as transient node also enters additional restrictions:
`document.append(dtd)` << work because we not use fragment (pass one argument)
 `document.append(comment, dtd)` << faild because we can't put dtd to fragment [ensure pre-insertion validity](https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity)






-- 
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/issues/433#issuecomment-289330769

Received on Monday, 27 March 2017 00:55:33 UTC