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; |