- From: Ryosuke Niwa <notifications@github.com>
- Date: Mon, 06 Apr 2020 17:07:07 -0700
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/dom/issues/808/610099830@github.com>
In WebKit, insertion and removal are different. Newly inserted nodes are notified in two stages: [`insertedIntoAncestor`](https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/dom/Node.h?rev=259575#L419) and [`didFinishInsertingNodes`](https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/dom/Node.h?rev=259575#L420). The former is responsible for updating internal node's states and not allowed to execute any scripts. The latter is called on a subset of nodes which may execute scripts after node insertion. A subset of elements such as `HTMLScriptElement` [overrides it](https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/dom/ScriptElement.cpp?rev=259575#L84) to [execute scripts](https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/dom/ScriptElement.cpp?rev=259575#L84). Both of these things happen synchronously as we remove nodes. During [removal](https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/dom/ContainerNode.cpp?rev=257192#L81), we disconnect all subframes first (during which introduction of nested browsing contexts are prohibited) and then remove nodes but we don't allow any scripts to execute as a result of removing nodes once we start removing nodes. All of this happens synchronously. -- 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/808#issuecomment-610099830
Received on Tuesday, 7 April 2020 00:07:22 UTC