| 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 5f09e359e56e5651e224ee5b70822a5adc44538d..c312b2cfdabe902c8489b109d7b4eeedcb77555e 100644
|
| --- a/third_party/WebKit/Source/core/dom/ContainerNode.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/ContainerNode.cpp
|
| @@ -703,7 +703,7 @@ void ContainerNode::notifyNodeInserted(Node& root, ChildrenChangeSource source)
|
| childrenChanged(ChildrenChange::forInsertion(root, source));
|
|
|
| for (const auto& targetNode : postInsertionNotificationTargets) {
|
| - if (targetNode->inShadowIncludingDocument())
|
| + if (targetNode->isConnected())
|
| targetNode->didNotifySubtreeInsertionsToDocument();
|
| }
|
| }
|
| @@ -716,7 +716,7 @@ void ContainerNode::notifyNodeInsertedInternal(Node& root, NodeVector& postInser
|
| for (Node& node : NodeTraversal::inclusiveDescendantsOf(root)) {
|
| // As an optimization we don't notify leaf nodes when when inserting
|
| // into detached subtrees that are not in a shadow tree.
|
| - if (!inShadowIncludingDocument() && !isInShadowTree() && !node.isContainerNode())
|
| + if (!isConnected() && !isInShadowTree() && !node.isContainerNode())
|
| continue;
|
| if (Node::InsertionShouldCallDidNotifySubtreeInsertions == node.insertedInto(this))
|
| postInsertionNotificationTargets.append(&node);
|
| @@ -1132,7 +1132,7 @@ static void dispatchChildInsertionEvents(Node& child)
|
| c->dispatchScopedEvent(MutationEvent::create(EventTypeNames::DOMNodeInserted, true, c->parentNode()));
|
|
|
| // dispatch the DOMNodeInsertedIntoDocument event to all descendants
|
| - if (c->inShadowIncludingDocument() && document->hasListenerType(Document::DOMNODEINSERTEDINTODOCUMENT_LISTENER)) {
|
| + if (c->isConnected() && document->hasListenerType(Document::DOMNODEINSERTEDINTODOCUMENT_LISTENER)) {
|
| for (; c; c = NodeTraversal::next(*c, &child))
|
| c->dispatchScopedEvent(MutationEvent::create(EventTypeNames::DOMNodeInsertedIntoDocument, false));
|
| }
|
| @@ -1161,7 +1161,7 @@ static void dispatchChildRemovalEvents(Node& child)
|
| }
|
|
|
| // Dispatch the DOMNodeRemovedFromDocument event to all descendants.
|
| - if (c->inShadowIncludingDocument() && document->hasListenerType(Document::DOMNODEREMOVEDFROMDOCUMENT_LISTENER)) {
|
| + if (c->isConnected() && document->hasListenerType(Document::DOMNODEREMOVEDFROMDOCUMENT_LISTENER)) {
|
| NodeChildRemovalTracker scope(child);
|
| for (; c; c = NodeTraversal::next(*c, &child))
|
| c->dispatchScopedEvent(MutationEvent::create(EventTypeNames::DOMNodeRemovedFromDocument, false));
|
|
|