Skip to content

Commit

Permalink
Defer widget updates in ContainerNode::parserRemoveChild.
Browse files Browse the repository at this point in the history
ContainerNode::parserRemoveChild is the only consumer of ContainerNode::removeBetween that doesn't defer widget updates during the call. This could potentially lead to problems with scripts running at an inopportune time.

This patch adds a RAII guard that runs deferred widget updates at the end of parserRemoveChild.

BUG=560011

Review URL: https://codereview.chromium.org/1464223002

Cr-Commit-Position: refs/heads/master@{#363154}
  • Loading branch information
marius.mlynski authored and Commit bot committed Dec 4, 2015
1 parent 05ecdca commit 05926d6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions third_party/WebKit/Source/core/dom/ContainerNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,7 @@ void ContainerNode::parserRemoveChild(Node& oldChild)
ChildListMutationScope(*this).willRemoveChild(oldChild);
oldChild.notifyMutationObserversNodeWillDetach();

HTMLFrameOwnerElement::UpdateSuspendScope suspendWidgetHierarchyUpdates;
Node* prev = oldChild.previousSibling();
Node* next = oldChild.nextSibling();
removeBetween(prev, next, oldChild);
Expand Down

0 comments on commit 05926d6

Please sign in to comment.