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..404c3510122d9af8d674d5bc1c396dea30873d21 100644 |
| --- a/third_party/WebKit/Source/core/dom/Node.cpp |
| +++ b/third_party/WebKit/Source/core/dom/Node.cpp |
| @@ -450,6 +450,15 @@ Node* Node::pseudoAwareLastChild() const |
| return lastChild(); |
| } |
| +Node* Node::treeRoot() |
| +{ |
| + Node* node = this; |
| + while (!isTreeScopeRoot(node)) { |
|
kochi
2016/01/27 09:18:50
style nit: if the loop body is one-liner, you have
kochi
2016/01/27 09:18:50
You can get its treeroot by treeScope().rootNode()
yuzuchan
2016/01/28 06:23:56
Done.
yuzuchan
2016/01/28 06:23:56
Done.
|
| + node = node->parentNode(); |
|
kochi
2016/01/27 09:18:50
This doesn't work for detached tree (i.e. not in d
yuzuchan
2016/01/28 06:23:56
Done.
|
| + } |
| + return node; |
| +} |
| + |
| PassRefPtrWillBeRawPtr<Node> Node::insertBefore(PassRefPtrWillBeRawPtr<Node> newChild, Node* refChild, ExceptionState& exceptionState) |
| { |
| if (isContainerNode()) |