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

Unified Diff: Source/core/loader/FormSubmission.cpp

Issue 193623002: Use new is*Element() helper functions more in core/ code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | « Source/core/clipboard/Clipboard.cpp ('k') | Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/FormSubmission.cpp
diff --git a/Source/core/loader/FormSubmission.cpp b/Source/core/loader/FormSubmission.cpp
index 03601a4e67dde9fc0543183701854b0f311d1de2..0803be17ad9a8a4c317df62b7528d5ce1235843c 100644
--- a/Source/core/loader/FormSubmission.cpp
+++ b/Source/core/loader/FormSubmission.cpp
@@ -215,14 +215,15 @@ PassRefPtr<FormSubmission> FormSubmission::create(HTMLFormElement* form, const A
bool containsPasswordData = false;
for (unsigned i = 0; i < form->associatedElements().size(); ++i) {
FormAssociatedElement* control = form->associatedElements()[i];
- HTMLElement* element = toHTMLElement(control);
- if (!element->isDisabledFormControl())
+ ASSERT(control);
+ HTMLElement& element = toHTMLElement(*control);
+ if (!element.isDisabledFormControl())
control->appendFormData(*domFormData, isMultiPartForm);
- if (element->hasTagName(inputTag)) {
- HTMLInputElement* input = toHTMLInputElement(element);
- if (input->isTextField())
- formValues.append(pair<String, String>(input->name().string(), input->value()));
- if (input->isPasswordField() && !input->value().isEmpty())
+ if (isHTMLInputElement(element)) {
+ HTMLInputElement& input = toHTMLInputElement(element);
+ if (input.isTextField())
+ formValues.append(pair<String, String>(input.name().string(), input.value()));
+ if (input.isPasswordField() && !input.value().isEmpty())
containsPasswordData = true;
}
}
« no previous file with comments | « Source/core/clipboard/Clipboard.cpp ('k') | Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698