Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Issue 2306323002: Change the timing of event dispatching and <script> execution in Node::appendChild, insertBefore,... (Closed)

Created:
4 years, 3 months ago by tkent
Modified:
4 years, 3 months ago
Reviewers:
hayato
CC:
blink-reviews, blink-reviews-dom_chromium.org, blink-reviews-w3ctests_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, rwlbuis, sof, tfarina
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Change the timing of event dispatching and <script> execution in Node::appendChild, insertBefore, and replaceChild. When we insert a DocumentFragment including multiple children into another node, * WebKit and Blink: DOMNodeInserted is dispatched just after each of DocumentFragment children was inserted. * Firefox and Edge: DOMNodeInserted is dispatched after all of DocumentFragment children were inserted. <script> execution and <iframe> load event have the same incompatibility. This CL makes Blink same as Firefox and Edge in order to improve interoperability and avoid additional hierarchy check for crbug.com/523157. Implementation: Fold updateTreeAfterInsertion() and notifyNodeInserted() into insertNodeVector(), and move childrenChange(), didNotifySubtreeInsertionsToDocument(), and dispatchChildInsertionEvents() out from the loop. Test changes: * fast/dom/MutationObserver/removed-out-of-order.html DOMNodeInserted timing change. New result matches to Firefox and Edge. BUG=523157 Committed: https://crrev.com/e15391d9a56a210cf5faee97c24bfad856225ea9 Cr-Commit-Position: refs/heads/master@{#417209}

Patch Set 1 #

Patch Set 2 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+73 lines, -24 lines) Patch
M third_party/WebKit/LayoutTests/fast/dom/MutationObserver/removed-out-of-order.html View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/dom/MutationObserver/removed-out-of-order-expected.txt View 1 chunk +3 lines, -3 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/dom/mutation-event-for-fragment-insertion.html View 1 chunk +43 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/ContainerNode.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/ContainerNode.cpp View 1 2 chunks +24 lines, -17 lines 4 comments Download

Messages

Total messages: 26 (17 generated)
tkent
hayato@, would you review this please? https://codereview.chromium.org/2306323002/diff/40001/third_party/WebKit/Source/core/dom/ContainerNode.cpp File third_party/WebKit/Source/core/dom/ContainerNode.cpp (right): https://codereview.chromium.org/2306323002/diff/40001/third_party/WebKit/Source/core/dom/ContainerNode.cpp#newcode164 third_party/WebKit/Source/core/dom/ContainerNode.cpp:164: // TODO(tkent): mutator ...
4 years, 3 months ago (2016-09-08 04:52:45 UTC) #14
hayato
Is this diff all? Didn't notifyNodeInserted(child) change?
4 years, 3 months ago (2016-09-08 05:32:21 UTC) #15
tkent
On 2016/09/08 at 05:32:21, hayato wrote: > Is this diff all? Yes. > Didn't notifyNodeInserted(child) ...
4 years, 3 months ago (2016-09-08 05:45:07 UTC) #16
hayato
I see. I have one more question: https://codereview.chromium.org/2306323002/diff/40001/third_party/WebKit/Source/core/dom/ContainerNode.cpp File third_party/WebKit/Source/core/dom/ContainerNode.cpp (right): https://codereview.chromium.org/2306323002/diff/40001/third_party/WebKit/Source/core/dom/ContainerNode.cpp#newcode181 third_party/WebKit/Source/core/dom/ContainerNode.cpp:181: if (targetNode->parentNode() ...
4 years, 3 months ago (2016-09-08 06:18:55 UTC) #17
tkent
https://codereview.chromium.org/2306323002/diff/40001/third_party/WebKit/Source/core/dom/ContainerNode.cpp File third_party/WebKit/Source/core/dom/ContainerNode.cpp (right): https://codereview.chromium.org/2306323002/diff/40001/third_party/WebKit/Source/core/dom/ContainerNode.cpp#newcode181 third_party/WebKit/Source/core/dom/ContainerNode.cpp:181: if (targetNode->parentNode() == this) On 2016/09/08 at 06:18:55, hayato ...
4 years, 3 months ago (2016-09-08 06:31:09 UTC) #20
hayato
lgtm https://codereview.chromium.org/2306323002/diff/40001/third_party/WebKit/Source/core/dom/ContainerNode.cpp File third_party/WebKit/Source/core/dom/ContainerNode.cpp (right): https://codereview.chromium.org/2306323002/diff/40001/third_party/WebKit/Source/core/dom/ContainerNode.cpp#newcode181 third_party/WebKit/Source/core/dom/ContainerNode.cpp:181: if (targetNode->parentNode() == this) We chatted offline. We ...
4 years, 3 months ago (2016-09-08 06:48:11 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2306323002/40001
4 years, 3 months ago (2016-09-08 06:49:14 UTC) #23
commit-bot: I haz the power
Committed patchset #2 (id:40001)
4 years, 3 months ago (2016-09-08 06:52:58 UTC) #24
commit-bot: I haz the power
4 years, 3 months ago (2016-09-08 06:55:41 UTC) #26
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/e15391d9a56a210cf5faee97c24bfad856225ea9
Cr-Commit-Position: refs/heads/master@{#417209}

Powered by Google App Engine
This is Rietveld 408576698