2 ms·
Technically you should be adopting the node, but I guess browsers don't care: https://developer.mozilla.org/en-US/docs/Web/API/Document/adoptNode https://develo
by mmastrac 10y ago
Technically you should be adopting the node, but I guess browsers don't care: https://developer.mozilla.org/en-US/docs/Web/API/Document/adoptNode https://developer.mozilla.org/en-US/docs/Web/API/Document/ad...
- the8472 10y agoThat shouldn't affect the parser, because adoptNode "simply" (read: dark rituals involving goats) changes owner document and the prototype chain but not object identity, which means the node on the parser stack should still be valid. The trick here is that the the invoked behavior is spread over the HTML5 and DOM specs and maybe a little Ecmascript too. In isolation they appear sane, combined together they are loose enough that this hack does not run afoul of any rules.
- jaffathecake 10y agoAs far as I can tell, adopting happens automatically https://dom.spec.whatwg.org/#concept-node-pre-insert https://dom.spec.whatwg.org/#concept-node-pre-insert