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

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

Issue 2623513005: Introduce Element::AttributeModificationParams (Closed)
Patch Set: Created 3 years, 11 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/HTMLFormControlElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp b/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp
index 8daaf65db0fef4d4a266ef92fbb44a3e23fb3241..ba4a4469becd3ca1b0b118b2ab01a45db4cb745d 100644
--- a/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp
@@ -137,27 +137,25 @@ void HTMLFormControlElement::reset() {
}
void HTMLFormControlElement::attributeChanged(
- const QualifiedName& name,
- const AtomicString& oldValue,
- const AtomicString& newValue,
- AttributeModificationReason reason) {
- HTMLElement::attributeChanged(name, oldValue, newValue, reason);
- if (name == disabledAttr && oldValue.isNull() != newValue.isNull()) {
+ const AttributeModificationParams& params) {
+ HTMLElement::attributeChanged(params);
+ if (params.name == disabledAttr &&
+ params.oldValue.isNull() != params.newValue.isNull()) {
disabledAttributeChanged();
- if (reason == AttributeModificationReason::kDirectly &&
+ if (params.reason == AttributeModificationReason::kDirectly &&
isDisabledFormControl() && adjustedFocusedElementInTreeScope() == this)
blur();
}
}
-void HTMLFormControlElement::parseAttribute(const QualifiedName& name,
- const AtomicString& oldValue,
- const AtomicString& value) {
+void HTMLFormControlElement::parseAttribute(
+ const AttributeModificationParams& params) {
+ const QualifiedName& name = params.name;
if (name == formAttr) {
formAttributeChanged();
UseCounter::count(document(), UseCounter::FormAttribute);
} else if (name == readonlyAttr) {
- if (oldValue.isNull() != value.isNull()) {
+ if (params.oldValue.isNull() != params.newValue.isNull()) {
setNeedsWillValidateCheck();
pseudoStateChanged(CSSSelector::PseudoReadOnly);
pseudoStateChanged(CSSSelector::PseudoReadWrite);
@@ -166,14 +164,14 @@ void HTMLFormControlElement::parseAttribute(const QualifiedName& name,
ReadOnlyControlState);
}
} else if (name == requiredAttr) {
- if (oldValue.isNull() != value.isNull())
+ if (params.oldValue.isNull() != params.newValue.isNull())
requiredAttributeChanged();
UseCounter::count(document(), UseCounter::RequiredAttribute);
} else if (name == autofocusAttr) {
- HTMLElement::parseAttribute(name, oldValue, value);
+ HTMLElement::parseAttribute(params);
UseCounter::count(document(), UseCounter::AutoFocusAttribute);
} else {
- HTMLElement::parseAttribute(name, oldValue, value);
+ HTMLElement::parseAttribute(params);
}
}
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLFormControlElement.h ('k') | third_party/WebKit/Source/core/html/HTMLFormElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698