| Index: third_party/WebKit/Source/core/dom/Node.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/Node.cpp b/third_party/WebKit/Source/core/dom/Node.cpp
|
| index a4045106859b7e4c826f9454f50db7776a577b3f..9ca86e5dfd6ed968784f25ac1b901946f5bd8705 100644
|
| --- a/third_party/WebKit/Source/core/dom/Node.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/Node.cpp
|
| @@ -457,7 +457,7 @@ Node* Node::pseudoAwareLastChild() const
|
| Node& Node::treeRoot() const
|
| {
|
| if (isInTreeScope())
|
| - return treeScope().rootNode();
|
| + return treeScopeOrDocument().rootNode();
|
| const Node* node = this;
|
| while (node->parentNode())
|
| node = node->parentNode();
|
| @@ -798,7 +798,7 @@ bool Node::isDescendantOf(const Node *other) const
|
| // Return true if other is an ancestor of this, otherwise false
|
| if (!other || !other->hasChildren() || inShadowIncludingDocument() != other->inShadowIncludingDocument())
|
| return false;
|
| - if (other->treeScope() != treeScope())
|
| + if (other->treeScopeOrDocument() != treeScopeOrDocument())
|
| return false;
|
| if (other->isTreeScope())
|
| return !isTreeScope();
|
| @@ -836,7 +836,7 @@ bool Node::isShadowIncludingInclusiveAncestorOf(const Node* node) const
|
| return false;
|
|
|
| for (; node; node = node->shadowHost()) {
|
| - if (treeScope() == node->treeScope())
|
| + if (treeScopeOrDocument() == node->treeScopeOrDocument())
|
| return contains(node);
|
| }
|
|
|
| @@ -846,7 +846,7 @@ bool Node::isShadowIncludingInclusiveAncestorOf(const Node* node) const
|
| Node* Node::retarget(const Node& target) const
|
| {
|
| for (const Node* ancestor = ⌖ ancestor; ancestor = ancestor->shadowHost()) {
|
| - if (treeScope() == ancestor->treeScope())
|
| + if (treeScopeOrDocument() == ancestor->treeScopeOrDocument())
|
| return const_cast<Node*>(ancestor);
|
| }
|
| return nullptr;
|
| @@ -1049,7 +1049,7 @@ Element* Node::shadowHost() const
|
|
|
| ShadowRoot* Node::containingShadowRoot() const
|
| {
|
| - Node& root = treeScope().rootNode();
|
| + Node& root = treeScopeOrDocument().rootNode();
|
| return root.isShadowRoot() ? toShadowRoot(&root) : nullptr;
|
| }
|
|
|
| @@ -1441,7 +1441,7 @@ unsigned short Node::compareDocumentPosition(const Node* otherNode, ShadowTreesT
|
| // 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 inShadowIncludingDocument() all the time (which seems like a bug).
|
| - if (start1->inShadowIncludingDocument() != start2->inShadowIncludingDocument() || (treatment == TreatShadowTreesAsDisconnected && start1->treeScope() != start2->treeScope())) {
|
| + if (start1->inShadowIncludingDocument() != start2->inShadowIncludingDocument() || (treatment == TreatShadowTreesAsDisconnected && start1->treeScopeOrDocument() != start2->treeScopeOrDocument())) {
|
| unsigned short direction = (this > otherNode) ? DOCUMENT_POSITION_PRECEDING : DOCUMENT_POSITION_FOLLOWING;
|
| return DOCUMENT_POSITION_DISCONNECTED | DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC | direction;
|
| }
|
| @@ -1462,7 +1462,7 @@ unsigned short Node::compareDocumentPosition(const Node* otherNode, ShadowTreesT
|
| 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->treeScopeOrDocument() != start2->treeScopeOrDocument() ? DOCUMENT_POSITION_DISCONNECTED | DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC : 0;
|
|
|
| // Walk the two chains backwards and look for the first difference.
|
| for (unsigned i = std::min(index1, index2); i; --i) {
|
| @@ -2262,7 +2262,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();
|
| + treeScopeOrDocument().removedLastRefToScope();
|
| return;
|
| }
|
|
|
|
|