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

I've noticed two pre-DOM queues: one for the `DOMNodeRemoved` mutation event (I've yet to investigate the others, not a priority I agree), and one for `iframe.onunload` callbacks in Chrome and Safari.

The latter intermixes JS callbacks and state changes (each `iframe.contentWindow` is set to null just after its `iframe.onuload` runs).

If they can't be moved post-DOM for Web compat reasons, a possible mitigation would be, when DOM operations are triggered from JS, to register every node involved in a Set, and to prevent as many mutations as possible on these nodes from the pre-DOM hooks. This would move us closer to transactional behavior.

I suppose the list of operations that can be safely prohibited could be determined thanks to telemetry.

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

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

Received on Wednesday, 15 February 2023 11:10:55 UTC