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

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

Issue 2149893003: Rename Node::inShadowIncludingDocument() to Node::isConnected() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed Created 4 years, 5 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: 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));
« no previous file with comments | « third_party/WebKit/Source/core/clipboard/DataTransfer.cpp ('k') | third_party/WebKit/Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698