Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: third_party/WebKit/Source/core/html/HTMLLabelElement.cpp

Issue 1885453002: Rename Node::treeScope() to Node::treeScopeOrDocument() Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLInputElement.cpp ('k') | third_party/WebKit/Source/core/html/HTMLMapElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698