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 cd7c635bd7043f6e6117e15a99236bc77c855474..5cfa24813f52ed0a8ad47c601ea6082773f6c142 100644 |
--- a/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp |
+++ b/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp |
@@ -49,10 +49,7 @@ using namespace HTMLNames; |
HTMLFormControlElement::HTMLFormControlElement(const QualifiedName& tagName, Document& document, HTMLFormElement* form) |
: LabelableElement(tagName, document) |
- , m_disabled(false) |
, m_isAutofilled(false) |
- , m_isReadOnly(false) |
- , m_isRequired(false) |
, m_hasValidationMessage(false) |
, m_ancestorDisabledState(AncestorDisabledStateUnknown) |
, m_dataListAncestorState(Unknown) |
@@ -163,14 +160,10 @@ void HTMLFormControlElement::parseAttribute(const QualifiedName& name, const Ato |
formAttributeChanged(); |
UseCounter::count(document(), UseCounter::FormAttribute); |
} else if (name == disabledAttr) { |
- bool oldDisabled = m_disabled; |
- m_disabled = !value.isNull(); |
- if (oldDisabled != m_disabled) |
+ if (oldValue.isNull() != value.isNull()) |
disabledAttributeChanged(); |
} else if (name == readonlyAttr) { |
- bool wasReadOnly = m_isReadOnly; |
- m_isReadOnly = !value.isNull(); |
- if (wasReadOnly != m_isReadOnly) { |
+ if (oldValue.isNull() != value.isNull()) { |
setNeedsWillValidateCheck(); |
pseudoStateChanged(CSSSelector::PseudoReadOnly); |
pseudoStateChanged(CSSSelector::PseudoReadWrite); |
@@ -178,9 +171,7 @@ void HTMLFormControlElement::parseAttribute(const QualifiedName& name, const Ato |
LayoutTheme::theme().controlStateChanged(*layoutObject(), ReadOnlyControlState); |
} |
} else if (name == requiredAttr) { |
- bool wasRequired = m_isRequired; |
- m_isRequired = !value.isNull(); |
- if (wasRequired != m_isRequired) |
+ if (oldValue.isNull() != value.isNull()) |
requiredAttributeChanged(); |
UseCounter::count(document(), UseCounter::RequiredAttribute); |
} else if (name == autofocusAttr) { |
@@ -356,7 +347,7 @@ HTMLFormElement* HTMLFormControlElement::formOwner() const |
bool HTMLFormControlElement::isDisabledFormControl() const |
{ |
- if (m_disabled) |
+ if (fastHasAttribute(disabledAttr)) |
return true; |
if (m_ancestorDisabledState == AncestorDisabledStateUnknown) |
@@ -366,7 +357,7 @@ bool HTMLFormControlElement::isDisabledFormControl() const |
bool HTMLFormControlElement::isRequired() const |
{ |
- return m_isRequired; |
+ return fastHasAttribute(requiredAttr); |
} |
String HTMLFormControlElement::resultForDialogSubmit() |