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

Unified Diff: Source/core/dom/Node.cpp

Issue 23890025: WIP (Introduce WTF::NonNullPtr<T>.) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/dom/SelectorQuery.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Node.cpp
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp
index 0e3d2cb0e0128ad9d41ed42a2eb9dfc42a453c71..1d62f6a3bd5c6240506f11f6ab2dea17170c3ffe 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -910,7 +910,7 @@ bool Node::isDescendantOf(const Node *other) const
// Return true if other is an ancestor of this, otherwise false
if (!other || !other->hasChildNodes() || inDocument() != other->inDocument())
return false;
- if (&other->treeScope() != &treeScope())
+ if (other->treeScope() != treeScope())
return false;
if (other->isTreeScope())
return !isTreeScope();
@@ -948,7 +948,7 @@ bool Node::containsIncludingShadowDOM(const Node* node) const
return false;
for (; node; node = node->shadowHost()) {
- if (&treeScope() == &node->treeScope())
+ if (treeScope() == node->treeScope())
return contains(node);
}
@@ -1159,7 +1159,7 @@ Node* Node::deprecatedShadowAncestorNode() const
ShadowRoot* Node::containingShadowRoot() const
{
- Node* root = treeScope().rootNode();
+ Node* root = treeScope()->rootNode();
return root && root->isShadowRoot() ? toShadowRoot(root) : 0;
}
@@ -1707,7 +1707,7 @@ unsigned short Node::compareDocumentPositionInternal(const Node* otherNode, Shad
// If one node is in the document and the other is not, we must be disconnected.
// If the nodes have different owning documents, they must be disconnected. Note that we avoid
// comparing Attr nodes here, since they return false from inDocument() all the time (which seems like a bug).
- if (start1->inDocument() != start2->inDocument() || (treatment == TreatShadowTreesAsDisconnected && &start1->treeScope() != &start2->treeScope())) {
+ if (start1->inDocument() != start2->inDocument() || (treatment == TreatShadowTreesAsDisconnected && start1->treeScope() != start2->treeScope())) {
unsigned short direction = (this > otherNode) ? DOCUMENT_POSITION_PRECEDING : DOCUMENT_POSITION_FOLLOWING;
return DOCUMENT_POSITION_DISCONNECTED | DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC | direction;
}
@@ -1728,7 +1728,7 @@ unsigned short Node::compareDocumentPositionInternal(const Node* otherNode, Shad
return DOCUMENT_POSITION_DISCONNECTED | DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC | direction;
}
- unsigned connection = &start1->treeScope() != &start2->treeScope() ? DOCUMENT_POSITION_DISCONNECTED | DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC : 0;
+ unsigned connection = start1->treeScope() != start2->treeScope() ? DOCUMENT_POSITION_DISCONNECTED | DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC : 0;
// Walk the two chains backwards and look for the first difference.
for (unsigned i = min(index1, index2); i; --i) {
@@ -2507,7 +2507,7 @@ void Node::removedLastRef()
// faster for non-Document nodes, and because the call to removedLastRef that is inlined
// at all deref call sites is smaller if it's a non-virtual function.
if (isTreeScope()) {
- treeScope().removedLastRefToScope();
+ treeScope()->removedLastRefToScope();
return;
}
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/dom/SelectorQuery.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698