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

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

Issue 60573007: Non-activated default buttons prevent implicit form submission. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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: Source/core/html/HTMLFormControlElement.cpp
diff --git a/Source/core/html/HTMLFormControlElement.cpp b/Source/core/html/HTMLFormControlElement.cpp
index e3c52907a668e751fff8cea93f78764b3a88191a..1cb8c3b46f222881b1e53e2512c6e8c10d431f5a 100644
--- a/Source/core/html/HTMLFormControlElement.cpp
+++ b/Source/core/html/HTMLFormControlElement.cpp
@@ -503,6 +503,13 @@ HTMLFormElement* HTMLFormControlElement::virtualForm() const
return FormAssociatedElement::form();
}
+bool HTMLFormControlElement::isSuccessfulSubmitButton() const
+{
+ // HTML spec says that buttons must have names to be considered successful.
+ // However, other browsers do not impose this constraint. So we do not.
+ return canBeSuccessfulSubmitButton() && !isDisabledFormControl();
+}
+
bool HTMLFormControlElement::isDefaultButtonForForm() const
{
return isSuccessfulSubmitButton() && form() && form()->defaultButton() == this;

Powered by Google App Engine
This is Rietveld 408576698