| 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 bfa2f957134104d4f3a4c2938b652eb75623b341..1cefbd5b634c66d41e044f9e31e479ec5bf7e893 100644
|
| --- a/third_party/WebKit/Source/core/dom/ContainerNode.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/ContainerNode.cpp
|
| @@ -231,7 +231,7 @@ Node* ContainerNode::insertBefore(Node* newChild, Node* refChild, ExceptionState
|
| EventDispatchForbiddenScope assertNoEventDispatch;
|
| ScriptForbiddenScope forbidScript;
|
|
|
| - treeScope().adoptIfNeeded(child);
|
| + treeScopeOrDocument().adoptIfNeeded(child);
|
| insertBeforeCommon(*next, child);
|
| }
|
|
|
| @@ -321,7 +321,7 @@ void ContainerNode::parserInsertBefore(Node* newChild, Node& nextChild)
|
| EventDispatchForbiddenScope assertNoEventDispatch;
|
| ScriptForbiddenScope forbidScript;
|
|
|
| - treeScope().adoptIfNeeded(*newChild);
|
| + treeScopeOrDocument().adoptIfNeeded(*newChild);
|
| insertBeforeCommon(nextChild, *newChild);
|
| DCHECK_EQ(newChild->connectedSubframeCount(), 0u);
|
| ChildListMutationScope(*this).childAdded(*newChild);
|
| @@ -408,7 +408,7 @@ Node* ContainerNode::replaceChild(Node* newChild, Node* oldChild, ExceptionState
|
| if (child.parentNode())
|
| break;
|
|
|
| - treeScope().adoptIfNeeded(child);
|
| + treeScopeOrDocument().adoptIfNeeded(child);
|
|
|
| // Add child before "next".
|
| {
|
| @@ -757,7 +757,7 @@ Node* ContainerNode::appendChild(Node* newChild, ExceptionState& exceptionState)
|
| EventDispatchForbiddenScope assertNoEventDispatch;
|
| ScriptForbiddenScope forbidScript;
|
|
|
| - treeScope().adoptIfNeeded(child);
|
| + treeScopeOrDocument().adoptIfNeeded(child);
|
| appendChildCommon(child);
|
| }
|
|
|
| @@ -790,7 +790,7 @@ void ContainerNode::parserAppendChild(Node* newChild)
|
| EventDispatchForbiddenScope assertNoEventDispatch;
|
| ScriptForbiddenScope forbidScript;
|
|
|
| - treeScope().adoptIfNeeded(*newChild);
|
| + treeScopeOrDocument().adoptIfNeeded(*newChild);
|
| appendChildCommon(*newChild);
|
| DCHECK_EQ(newChild->connectedSubframeCount(), 0u);
|
| ChildListMutationScope(*this).childAdded(*newChild);
|
| @@ -1466,7 +1466,7 @@ Element* ContainerNode::getElementById(const AtomicString& id) const
|
| if (isInTreeScope()) {
|
| // Fast path if we are in a tree scope: call getElementById() on tree scope
|
| // and check if the matching element is in our subtree.
|
| - Element* element = treeScope().getElementById(id);
|
| + Element* element = treeScopeOrDocument().getElementById(id);
|
| if (!element)
|
| return nullptr;
|
| if (element->isDescendantOf(this))
|
|
|