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

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

Issue 25389004: Notify nodes removal to Range/Selection after dispatching blur and mutation event (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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
« no previous file with comments | « LayoutTests/fast/dom/Range/range-after-remove-children-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ContainerNode.cpp
diff --git a/Source/core/dom/ContainerNode.cpp b/Source/core/dom/ContainerNode.cpp
index 7de1712a03c22b9aa36bec7ac9df8f964ddb5bb9..515209937bb2f9981bfa8932f567db36d0eef1a2 100644
--- a/Source/core/dom/ContainerNode.cpp
+++ b/Source/core/dom/ContainerNode.cpp
@@ -401,8 +401,6 @@ static void willRemoveChildren(ContainerNode* container)
NodeVector children;
getChildNodes(container, children);
- container->document().nodeChildrenWillBeRemoved(container);
-
ChildListMutationScope mutation(container);
for (NodeVector::const_iterator it = children.begin(); it != children.end(); it++) {
Node* child = it->get();
@@ -413,6 +411,7 @@ static void willRemoveChildren(ContainerNode* container)
dispatchChildRemovalEvents(child);
}
+ container->document().nodeChildrenWillBeRemoved(container); // e.g. mutation event listener can create a new range.
tkent 2013/10/04 05:21:39 After this line, It is possible to dispatch 'blur'
yosin_UTC9 2013/10/04 08:09:30 It is safe in 'DOMSubtreeModfified' event handler,
tkent 2013/10/06 23:46:54 The comment in removeChildren says: // T
ChildFrameDisconnector(container).disconnect(ChildFrameDisconnector::DescendantsOnly);
}
« no previous file with comments | « LayoutTests/fast/dom/Range/range-after-remove-children-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698