Chromium Code Reviews| Index: Source/core/dom/ContainerNode.cpp |
| diff --git a/Source/core/dom/ContainerNode.cpp b/Source/core/dom/ContainerNode.cpp |
| index ce718da1e55f91bd9880f00fe5f64e59af609d9b..acd9565113dd06c1c828accfb1efed944b8c627c 100644 |
| --- a/Source/core/dom/ContainerNode.cpp |
| +++ b/Source/core/dom/ContainerNode.cpp |
| @@ -850,9 +850,9 @@ void ContainerNode::notifyNodeRemoved(Node& root) |
| for (Node& node : NodeTraversal::inclusiveDescendantsOf(root)) { |
| // As an optimization we skip notifying Text nodes and other leaf nodes |
| - // of removal when they're not in the Document tree since the virtual |
| + // of removal when they're not in the Document tree and not in a shadow root since the virtual |
| // call to removedFrom is not needed. |
| - if (!node.inDocument() && !node.isContainerNode()) |
| + if (!node.inDocument() && !node.isContainerNode() && !node.isInShadowTree()) |
|
rhogan
2015/06/24 20:20:22
Strictly, shouldn't this be: if (inDocument() ..
|
| continue; |
| node.removedFrom(this); |
| for (ShadowRoot* shadowRoot = node.youngestShadowRoot(); shadowRoot; shadowRoot = shadowRoot->olderShadowRoot()) |