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

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

Issue 1496773002: Move code in some attributeChanged overrides to parseAttribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 670b5fc9cb90a267f7edc9701bcd4ff202c4671c..52932b17fe7915fa4a9c2309f085f4ce51c5d308 100644
--- a/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp
@@ -235,16 +235,6 @@ void HTMLLabelElement::updateLabel(TreeScope& scope, const AtomicString& oldForA
scope.addLabel(newForAttributeValue, this);
}
-void HTMLLabelElement::attributeChanged(const QualifiedName& name, const AtomicString& oldValue, const AtomicString& newValue, AttributeModificationReason reason)
-{
- if (name == HTMLNames::forAttr) {
- TreeScope& scope = treeScope();
- if (scope.shouldCacheLabelsByForAttribute())
- updateLabel(scope, oldValue, newValue);
- }
- HTMLElement::attributeChanged(name, oldValue, newValue, reason);
-}
-
Node::InsertionNotificationRequest HTMLLabelElement::insertedInto(ContainerNode* insertionPoint)
{
InsertionNotificationRequest result = HTMLElement::insertedInto(insertionPoint);
@@ -286,6 +276,11 @@ void HTMLLabelElement::parseAttribute(const QualifiedName& attributeName, const
formAttributeChanged();
UseCounter::count(document(), UseCounter::HTMLLabelElementFormContentAttribute);
} else {
+ if (attributeName == forAttr) {
+ TreeScope& scope = treeScope();
+ if (scope.shouldCacheLabelsByForAttribute())
+ updateLabel(scope, oldValue, attributeValue);
+ }
HTMLElement::parseAttribute(attributeName, oldValue, attributeValue);
}
}
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLLabelElement.h ('k') | third_party/WebKit/Source/core/html/HTMLLinkElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698