| Index: Source/core/html/HTMLFormControlElement.cpp
|
| diff --git a/Source/core/html/HTMLFormControlElement.cpp b/Source/core/html/HTMLFormControlElement.cpp
|
| index 3526e51947edbc61ba26f5b8826b2fe9d2bd844c..2f06b0a87405b6efcea2b9d8ceacab58fef17c10 100644
|
| --- a/Source/core/html/HTMLFormControlElement.cpp
|
| +++ b/Source/core/html/HTMLFormControlElement.cpp
|
| @@ -185,9 +185,8 @@ void HTMLFormControlElement::disabledAttributeChanged()
|
| void HTMLFormControlElement::requiredAttributeChanged()
|
| {
|
| setNeedsValidityCheck();
|
| - // Style recalculation is needed because style selectors may include
|
| - // :required and :optional pseudo-classes.
|
| - setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::fromAttribute(requiredAttr));
|
| + pseudoStateChanged(CSSSelector::PseudoRequired);
|
| + pseudoStateChanged(CSSSelector::PseudoOptional);
|
| }
|
|
|
| bool HTMLFormControlElement::supportsAutofocus() const
|
| @@ -518,7 +517,8 @@ void HTMLFormControlElement::setNeedsValidityCheck()
|
| if (willValidate() && newIsValid != m_isValid) {
|
| formOwnerSetNeedsValidityCheck();
|
| // Update style for pseudo classes such as :valid :invalid.
|
| - setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Invalid));
|
| + pseudoStateChanged(CSSSelector::PseudoValid);
|
| + pseudoStateChanged(CSSSelector::PseudoInvalid);
|
| }
|
| m_isValid = newIsValid;
|
|
|
|
|