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

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

Issue 1764063002: Rename two functions related to 'default button' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLFormElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLFormElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLFormElement.cpp b/third_party/WebKit/Source/core/html/HTMLFormElement.cpp
index 978394019ed30490d4b3ac1942c8f025ae5db17c..001143f978f03eb6431ed56afae46f5464e279cc 100644
--- a/third_party/WebKit/Source/core/html/HTMLFormElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLFormElement.cpp
@@ -673,18 +673,16 @@ bool HTMLFormElement::wasUserSubmitted() const
return m_wasUserSubmitted;
}
-HTMLFormControlElement* HTMLFormElement::defaultButton() const
+HTMLFormControlElement* HTMLFormElement::findDefaultButton() const
{
- const FormAssociatedElement::List& elements = associatedElements();
- for (unsigned i = 0; i < elements.size(); ++i) {
- if (!elements[i]->isFormControlElement())
+ for (const auto& element : associatedElements()) {
+ if (!element->isFormControlElement())
continue;
- HTMLFormControlElement* control = toHTMLFormControlElement(elements[i]);
+ HTMLFormControlElement* control = toHTMLFormControlElement(element);
if (control->canBeSuccessfulSubmitButton())
return control;
}
-
- return 0;
+ return nullptr;
}
bool HTMLFormElement::checkValidity()
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLFormElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698