| Index: third_party/WebKit/Source/core/html/HTMLLabelElement.cpp
|
| diff --git a/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp b/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp
|
| index 3e22538abda6aa9e686beee758233357f53f6624..96813c1229a248619e6838489711b4d6cbac089c 100644
|
| --- a/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp
|
| +++ b/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp
|
| @@ -72,7 +72,7 @@ LabelableElement* HTMLLabelElement::control() const
|
| return nullptr;
|
| }
|
|
|
| - if (Element* element = treeScope().getElementById(controlId)) {
|
| + if (Element* element = treeScopeOrDocument().getElementById(controlId)) {
|
| if (isLabelableElement(*element) && toLabelableElement(*element).supportLabels()) {
|
| if (!element->isFormControlElement())
|
| UseCounter::count(document(), UseCounter::HTMLLabelElementControlForNonFormAssociatedElement);
|
| @@ -262,8 +262,8 @@ Node::InsertionNotificationRequest HTMLLabelElement::insertedInto(ContainerNode*
|
| InsertionNotificationRequest result = HTMLElement::insertedInto(insertionPoint);
|
| FormAssociatedElement::insertedInto(insertionPoint);
|
| if (insertionPoint->isInTreeScope()) {
|
| - TreeScope& scope = insertionPoint->treeScope();
|
| - if (scope == treeScope() && scope.shouldCacheLabelsByForAttribute())
|
| + TreeScope& scope = insertionPoint->treeScopeOrDocument();
|
| + if (scope == treeScopeOrDocument() && scope.shouldCacheLabelsByForAttribute())
|
| updateLabel(scope, nullAtom, fastGetAttribute(forAttr));
|
| }
|
|
|
| @@ -276,8 +276,8 @@ Node::InsertionNotificationRequest HTMLLabelElement::insertedInto(ContainerNode*
|
|
|
| void HTMLLabelElement::removedFrom(ContainerNode* insertionPoint)
|
| {
|
| - if (insertionPoint->isInTreeScope() && treeScope() == document()) {
|
| - TreeScope& treeScope = insertionPoint->treeScope();
|
| + if (insertionPoint->isInTreeScope() && treeScopeOrDocument() == document()) {
|
| + TreeScope& treeScope = insertionPoint->treeScopeOrDocument();
|
| if (treeScope.shouldCacheLabelsByForAttribute())
|
| updateLabel(treeScope, fastGetAttribute(forAttr), nullAtom);
|
| }
|
| @@ -299,7 +299,7 @@ void HTMLLabelElement::parseAttribute(const QualifiedName& attributeName, const
|
| UseCounter::count(document(), UseCounter::HTMLLabelElementFormContentAttribute);
|
| } else {
|
| if (attributeName == forAttr) {
|
| - TreeScope& scope = treeScope();
|
| + TreeScope& scope = treeScopeOrDocument();
|
| if (scope.shouldCacheLabelsByForAttribute())
|
| updateLabel(scope, oldValue, attributeValue);
|
| }
|
|
|