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

Unified Diff: Source/WebCore/dom/ContainerNode.cpp

Issue 10914322: Merge 127534 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1229/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/WebCore/dom/ContainerNode.cpp
===================================================================
--- Source/WebCore/dom/ContainerNode.cpp (revision 128789)
+++ Source/WebCore/dom/ContainerNode.cpp (working copy)
@@ -352,8 +352,9 @@
// fire removed from document mutation events.
dispatchChildRemovalEvents(child);
- ChildFrameDisconnector(child).disconnect();
}
+
+ ChildFrameDisconnector(container, ChildFrameDisconnector::DoNotIncludeRoot).disconnect();
}
void ContainerNode::disconnectDescendantFrames()
@@ -384,14 +385,7 @@
}
RefPtr<Node> child = oldChild;
- willRemoveChild(child.get());
- // Mutation events might have moved this child into a different parent.
- if (child->parentNode() != this) {
- ec = NOT_FOUND_ERR;
- return false;
- }
-
document()->removeFocusedNodeOfSubtree(child.get());
#if ENABLE(FULLSCREEN_API)
@@ -405,6 +399,14 @@
return false;
}
+ willRemoveChild(child.get());
+
+ // Mutation events might have moved this child into a different parent.
+ if (child->parentNode() != this) {
+ ec = NOT_FOUND_ERR;
+ return false;
+ }
+
Node* prev = child->previousSibling();
Node* next = child->nextSibling();
removeBetween(prev, next, child.get());
@@ -470,10 +472,6 @@
// The container node can be removed from event handlers.
RefPtr<ContainerNode> protect(this);
- // Do any prep work needed before actually starting to detach
- // and remove... e.g. stop loading frames, fire unload events.
- willRemoveChildren(protect.get());
-
// exclude this node when looking for removed focusedNode since only children will be removed
document()->removeFocusedNodeOfSubtree(this, true);
@@ -481,6 +479,10 @@
document()->removeFullScreenElementOfSubtree(this, true);
#endif
+ // Do any prep work needed before actually starting to detach
+ // and remove... e.g. stop loading frames, fire unload events.
+ willRemoveChildren(protect.get());
+
forbidEventDispatch();
Vector<RefPtr<Node>, 10> removedChildren;
removedChildren.reserveInitialCapacity(childNodeCount());

Powered by Google App Engine
This is Rietveld 408576698