| Index: third_party/WebKit/Source/core/dom/Element.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
|
| index 7c0ce545a2e190f042784245f69865a1003d0b39..ce769f6b6ce5a9416bfa30078e651438efe95afc 100644
|
| --- a/third_party/WebKit/Source/core/dom/Element.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/Element.cpp
|
| @@ -1431,8 +1431,8 @@ Node::InsertionNotificationRequest Element::insertedInto(ContainerNode* insertio
|
| if (isUpgradedCustomElement() && inShadowIncludingDocument())
|
| CustomElement::didAttach(this, document());
|
|
|
| - TreeScope& scope = insertionPoint->treeScope();
|
| - if (scope != treeScope())
|
| + TreeScope& scope = insertionPoint->treeScopeOrDocument();
|
| + if (scope != treeScopeOrDocument())
|
| return InsertionDone;
|
|
|
| const AtomicString& idValue = getIdAttribute();
|
| @@ -1471,10 +1471,10 @@ void Element::removedFrom(ContainerNode* insertionPoint)
|
|
|
| setSavedLayerScrollOffset(IntSize());
|
|
|
| - if (insertionPoint->isInTreeScope() && treeScope() == document()) {
|
| + if (insertionPoint->isInTreeScope() && treeScopeOrDocument() == document()) {
|
| const AtomicString& idValue = getIdAttribute();
|
| if (!idValue.isNull())
|
| - updateId(insertionPoint->treeScope(), idValue, nullAtom);
|
| + updateId(insertionPoint->treeScopeOrDocument(), idValue, nullAtom);
|
|
|
| const AtomicString& nameValue = getNameAttribute();
|
| if (!nameValue.isNull())
|
| @@ -2186,7 +2186,7 @@ Attr* Element::setAttributeNode(Attr* attrNode, ExceptionState& exceptionState)
|
| setAttributeInternal(index, attrNode->getQualifiedName(), attrNode->value(), NotInSynchronizationOfLazyAttribute);
|
|
|
| attrNode->attachToElement(this, localName);
|
| - treeScope().adoptIfNeeded(*attrNode);
|
| + treeScopeOrDocument().adoptIfNeeded(*attrNode);
|
| ensureAttrNodeList().append(attrNode);
|
|
|
| return oldAttrNode;
|
| @@ -2224,7 +2224,7 @@ void Element::parseAttribute(const QualifiedName& name, const AtomicString&, con
|
| int tabindex = 0;
|
| if (value.isEmpty()) {
|
| clearTabIndexExplicitlyIfNeeded();
|
| - if (treeScope().adjustedFocusedElement() == this) {
|
| + if (treeScopeOrDocument().adjustedFocusedElement() == this) {
|
| // We might want to call blur(), but it's dangerous to dispatch
|
| // events here.
|
| document().setNeedsFocusedElementCheck();
|
| @@ -2422,7 +2422,7 @@ void Element::updateFocusAppearance(SelectionBehaviorOnFocus selectionBehavior)
|
| void Element::blur()
|
| {
|
| cancelFocusAppearanceUpdate();
|
| - if (treeScope().adjustedFocusedElement() == this) {
|
| + if (treeScopeOrDocument().adjustedFocusedElement() == this) {
|
| Document& doc = document();
|
| if (doc.page())
|
| doc.page()->focusController().setFocusedElement(0, doc.frame());
|
| @@ -3144,7 +3144,7 @@ inline void Element::updateId(const AtomicString& oldId, const AtomicString& new
|
| if (oldId == newId)
|
| return;
|
|
|
| - updateId(treeScope(), oldId, newId);
|
| + updateId(treeScopeOrDocument(), oldId, newId);
|
| }
|
|
|
| inline void Element::updateId(TreeScope& scope, const AtomicString& oldId, const AtomicString& newId)
|
| @@ -3309,7 +3309,7 @@ Attr* Element::ensureAttr(const QualifiedName& name)
|
| Attr* attrNode = attrIfExists(name);
|
| if (!attrNode) {
|
| attrNode = Attr::create(*this, name);
|
| - treeScope().adoptIfNeeded(*attrNode);
|
| + treeScopeOrDocument().adoptIfNeeded(*attrNode);
|
| ensureAttrNodeList().append(attrNode);
|
| }
|
| return attrNode;
|
|
|