Re: [whatwg/dom] Side effects due to tree insertion or removal (script, iframe) (#808)

Thank you for [the `load` event example](https://software.hixie.ch/utilities/js/live-dom-viewer/?.%3Cscript%3E%0Ai1%20%3D%20document.createElement(%22iframe%22)%3B%0Ai1.onload%20%3D%20()%20%3D%3E%20%7B%20w(i2.parentNode)%3B%20w(document.body.childElementCount)%20%7D%3B%0Ai2%20%3D%20document.createElement(%22iframe%22)%3B%0Ai2.onload%20%3Dw%3B%0Adocument.body.append(i1%2Ci2)%3B%0A%3C%2Fscript%3E). However, my results are different from yours. At least from what I'm seeing Chromium and Gecko don't execute the event listener until after both nodes are inserted. Could you share your test?

In any event, what we end up with has to be consistent. You cannot have some script execution be delayed, but still be able to do script execution with some other element. Consistency trumps any desire for atomic insert operations. (Atomicity per task can't really work by the way. Scripts already execute way sooner than that.)

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/808#issuecomment-1920762780
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/issues/808/1920762780@github.com>

Received on Thursday, 1 February 2024 08:29:31 UTC