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

Side by Side Diff: Source/core/loader/FormSubmission.cpp

Issue 16081007: Introduce toHTMLInputElement(Node*), and use it. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/html/shadow/TextFieldDecorationElement.cpp ('k') | Source/core/page/Chrome.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 WTF::TextEncoding dataEncoding = isMailtoForm ? UTF8Encoding() : FormDataBui lder::encodingFromAcceptCharset(copiedAttributes.acceptCharset(), document); 179 WTF::TextEncoding dataEncoding = isMailtoForm ? UTF8Encoding() : FormDataBui lder::encodingFromAcceptCharset(copiedAttributes.acceptCharset(), document);
180 RefPtr<DOMFormData> domFormData = DOMFormData::create(dataEncoding.encodingF orFormSubmission()); 180 RefPtr<DOMFormData> domFormData = DOMFormData::create(dataEncoding.encodingF orFormSubmission());
181 Vector<pair<String, String> > formValues; 181 Vector<pair<String, String> > formValues;
182 182
183 bool containsPasswordData = false; 183 bool containsPasswordData = false;
184 for (unsigned i = 0; i < form->associatedElements().size(); ++i) { 184 for (unsigned i = 0; i < form->associatedElements().size(); ++i) {
185 FormAssociatedElement* control = form->associatedElements()[i]; 185 FormAssociatedElement* control = form->associatedElements()[i];
186 HTMLElement* element = toHTMLElement(control); 186 HTMLElement* element = toHTMLElement(control);
187 if (!element->isDisabledFormControl()) 187 if (!element->isDisabledFormControl())
188 control->appendFormData(*domFormData, isMultiPartForm); 188 control->appendFormData(*domFormData, isMultiPartForm);
189 if (element->hasLocalName(inputTag)) { 189 if (element->hasTagName(inputTag)) {
190 HTMLInputElement* input = static_cast<HTMLInputElement*>(control); 190 HTMLInputElement* input = toHTMLInputElement(element);
191 if (input->isTextField()) 191 if (input->isTextField())
192 formValues.append(pair<String, String>(input->name().string(), i nput->value())); 192 formValues.append(pair<String, String>(input->name().string(), i nput->value()));
193 if (input->isPasswordField() && !input->value().isEmpty()) 193 if (input->isPasswordField() && !input->value().isEmpty())
194 containsPasswordData = true; 194 containsPasswordData = true;
195 } 195 }
196 } 196 }
197 197
198 RefPtr<FormData> formData; 198 RefPtr<FormData> formData;
199 String boundary; 199 String boundary;
200 200
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 frameRequest.resourceRequest().setHTTPContentType(m_contentType); 244 frameRequest.resourceRequest().setHTTPContentType(m_contentType);
245 else 245 else
246 frameRequest.resourceRequest().setHTTPContentType(m_contentType + "; boundary=" + m_boundary); 246 frameRequest.resourceRequest().setHTTPContentType(m_contentType + "; boundary=" + m_boundary);
247 } 247 }
248 248
249 frameRequest.resourceRequest().setURL(requestURL()); 249 frameRequest.resourceRequest().setURL(requestURL());
250 FrameLoader::addHTTPOriginIfNeeded(frameRequest.resourceRequest(), m_origin) ; 250 FrameLoader::addHTTPOriginIfNeeded(frameRequest.resourceRequest(), m_origin) ;
251 } 251 }
252 252
253 } 253 }
OLDNEW
« no previous file with comments | « Source/core/html/shadow/TextFieldDecorationElement.cpp ('k') | Source/core/page/Chrome.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698