Chromium Code Reviews| 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 405626d58eee2af4fcfb56cc1c1df90f662223e0..46bbcd9db1126f23e81abc55245fd594fa628904 100644 |
| --- a/third_party/WebKit/Source/core/dom/Node.cpp |
| +++ b/third_party/WebKit/Source/core/dom/Node.cpp |
| @@ -450,6 +450,16 @@ Node* Node::pseudoAwareLastChild() const |
| return lastChild(); |
| } |
| +Node* Node::treeRoot() |
| +{ |
| + if (this->inDocument() || this->isInShadowTree()) |
|
kochi
2016/01/28 06:46:11
You can combine this 2 conditions into isInTreeSco
yuzuchan
2016/02/01 04:59:54
Done.
|
| + return &this->treeScope().rootNode(); |
|
kochi
2016/01/28 06:46:11
You can omit 'this->'.
yuzuchan
2016/02/01 04:59:54
Done.
|
| + Node* node = this; |
| + while (node->parentNode()) |
| + node = node->parentNode(); |
| + return node; |
| +} |
| + |
| PassRefPtrWillBeRawPtr<Node> Node::insertBefore(PassRefPtrWillBeRawPtr<Node> newChild, Node* refChild, ExceptionState& exceptionState) |
| { |
| if (isContainerNode()) |