DescriptionChange 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
Messages
Total messages: 26 (17 generated)
|