DescriptionInvalidate :default pseudo classes when a default button is added or removed.
"default button" is the first submit button in tree order [1]. We need to
invalidate :default pseudo class when:
- Form control type is changed
- A submit button is associated to a form.
- A submit btuton is disassociated to a form.
for
- The submit button, and
- Other submit buttons associated to the form.
Implementation:
* HTMLButtonElement.cpp
Invalidate submit buttons associated to the form owner when |type| attribute
is udpated.
* HTMLInputElement.cpp
Invalidate submit buttons associated to the form owner when |type| attribute
is udpated and the previous type or the current type is a submit button.
* HTMLFormControlElement.cpp
When the form owner is changed, invalidate submit buttons associated to the
old form owner and the new form owner.
* HTMLFormElement.{cpp,h}
- Introduce HTMLFormElmement::invalidateDefaultButtonStyle.
- Introduce m_hasElementsAssociatedByFormAttribute
Refer to it during collecting associated elements instead of
IdTargetObserverRegistry::hasObservers.
IdTargetObserverRegistry::hasObservers didn't work well in
HTMLFormControlElement::didChangeForm because an observer is registered
after didChangeForm.
[1] https://html.spec.whatwg.org/multipage/forms.html#default-button
BUG=557683
TEST=automated
Committed: https://crrev.com/37d28d9b0dd82479ee7a1fc85ae11fcab6a4246b
Cr-Commit-Position: refs/heads/master@{#379190}
Patch Set 1 #
Total comments: 5
Patch Set 2 : return -> continue #
Messages
Total messages: 13 (4 generated)
|