Index: third_party/WebKit/Source/core/dom/ContainerNode.cpp |
diff --git a/third_party/WebKit/Source/core/dom/ContainerNode.cpp b/third_party/WebKit/Source/core/dom/ContainerNode.cpp |
index bcc1d15d6ee48710ad925aa2daf4b702795cb456..7ed010a47ed73b972232965f01854230d85092e4 100644 |
--- a/third_party/WebKit/Source/core/dom/ContainerNode.cpp |
+++ b/third_party/WebKit/Source/core/dom/ContainerNode.cpp |
@@ -604,8 +604,10 @@ void ContainerNode::removeBetween(Node* previousChild, Node* nextChild, Node& ol |
ASSERT(oldChild.parentNode() == this); |
- if (!oldChild.needsAttach()) |
- oldChild.detach(); |
+ AttachContext context; |
+ context.clearInvalidation = true; |
+ if (!needsAttach() || !oldChild.needsAttach()) |
+ oldChild.detach(context); |
if (nextChild) |
nextChild->setPreviousSibling(previousChild); |
@@ -883,6 +885,7 @@ void ContainerNode::detach(const AttachContext& context) |
{ |
AttachContext childrenContext(context); |
childrenContext.resolvedStyle = nullptr; |
+ childrenContext.clearInvalidation = true; |
for (Node* child = firstChild(); child; child = child->nextSibling()) |
child->detach(childrenContext); |