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

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

Issue 1858163002: Rename inDocument() to inShadowIncludingDocument() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 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 5d5b12b5fd4d4ccccbc1f61783bfd3b0dacad58d..d698d6a1ceb57021c8d987b7e42771868c7a0353 100644
--- a/third_party/WebKit/Source/core/dom/ContainerNode.cpp
+++ b/third_party/WebKit/Source/core/dom/ContainerNode.cpp
@@ -514,7 +514,7 @@ void ContainerNode::addChildNodesToDeletionQueue(Node*& head, Node*& tail, Conta
next->setPreviousSibling(nullptr);
if (!n->refCount()) {
- if (n->inDocument())
+ if (n->inShadowIncludingDocument())
container.document().decrementNodeCount();
#if ENABLE(SECURITY_ASSERT)
@@ -531,7 +531,7 @@ void ContainerNode::addChildNodesToDeletionQueue(Node*& head, Node*& tail, Conta
} else {
RawPtr<Node> protect(n); // removedFromDocument may remove all references to this node.
container.document().adoptIfNeeded(*n);
- if (n->inDocument())
+ if (n->inShadowIncludingDocument())
container.notifyNodeRemoved(*n);
}
}
@@ -830,7 +830,7 @@ void ContainerNode::notifyNodeInserted(Node& root, ChildrenChangeSource source)
childrenChanged(ChildrenChange::forInsertion(root, source));
for (const auto& targetNode : postInsertionNotificationTargets) {
- if (targetNode->inDocument())
+ if (targetNode->inShadowIncludingDocument())
targetNode->didNotifySubtreeInsertionsToDocument();
}
}
@@ -843,7 +843,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 (!inDocument() && !isInShadowTree() && !node.isContainerNode())
+ if (!inShadowIncludingDocument() && !isInShadowTree() && !node.isContainerNode())
continue;
if (Node::InsertionShouldCallDidNotifySubtreeInsertions == node.insertedInto(this))
postInsertionNotificationTargets.append(&node);
@@ -1248,7 +1248,7 @@ static void dispatchChildInsertionEvents(Node& child)
c->dispatchScopedEvent(MutationEvent::create(EventTypeNames::DOMNodeInserted, true, c->parentNode()));
// dispatch the DOMNodeInsertedIntoDocument event to all descendants
- if (c->inDocument() && document->hasListenerType(Document::DOMNODEINSERTEDINTODOCUMENT_LISTENER)) {
+ if (c->inShadowIncludingDocument() && document->hasListenerType(Document::DOMNODEINSERTEDINTODOCUMENT_LISTENER)) {
for (; c; c = NodeTraversal::next(*c, &child))
c->dispatchScopedEvent(MutationEvent::create(EventTypeNames::DOMNodeInsertedIntoDocument, false));
}
@@ -1275,7 +1275,7 @@ static void dispatchChildRemovalEvents(Node& child)
}
// Dispatch the DOMNodeRemovedFromDocument event to all descendants.
- if (c->inDocument() && document->hasListenerType(Document::DOMNODEREMOVEDFROMDOCUMENT_LISTENER)) {
+ if (c->inShadowIncludingDocument() && 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