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

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

Issue 1763553002: Invalidate :default pseudo classes when a default button is added or removed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: return -> continue Created 4 years, 10 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 406327fbc608a2c4325d2b79a3a0b3a89280845e..37736c59d0fbdb6271e964d17f5e5f795c21e778 100644
--- a/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp
@@ -301,12 +301,16 @@ void HTMLFormControlElement::willChangeForm()
{
FormAssociatedElement::willChangeForm();
formOwnerSetNeedsValidityCheck();
+ if (formOwner() && canBeSuccessfulSubmitButton())
+ formOwner()->invalidateDefaultButtonStyle();
}
void HTMLFormControlElement::didChangeForm()
{
FormAssociatedElement::didChangeForm();
formOwnerSetNeedsValidityCheck();
+ if (formOwner() && inDocument() && canBeSuccessfulSubmitButton())
+ formOwner()->invalidateDefaultButtonStyle();
}
void HTMLFormControlElement::formOwnerSetNeedsValidityCheck()
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLButtonElement.cpp ('k') | third_party/WebKit/Source/core/html/HTMLFormElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698