| OLD | NEW |
| 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 17 matching lines...) Expand all Loading... |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "core/loader/FormSubmission.h" | 32 #include "core/loader/FormSubmission.h" |
| 33 | 33 |
| 34 #include "core/HTMLNames.h" | 34 #include "core/HTMLNames.h" |
| 35 #include "core/InputTypeNames.h" | 35 #include "core/InputTypeNames.h" |
| 36 #include "core/dom/Document.h" | 36 #include "core/dom/Document.h" |
| 37 #include "core/events/Event.h" | 37 #include "core/events/Event.h" |
| 38 #include "core/html/DOMFormData.h" | 38 #include "core/html/FormData.h" |
| 39 #include "core/html/HTMLFormControlElement.h" | 39 #include "core/html/HTMLFormControlElement.h" |
| 40 #include "core/html/HTMLFormElement.h" | 40 #include "core/html/HTMLFormElement.h" |
| 41 #include "core/html/HTMLInputElement.h" | 41 #include "core/html/HTMLInputElement.h" |
| 42 #include "core/html/parser/HTMLParserIdioms.h" | 42 #include "core/html/parser/HTMLParserIdioms.h" |
| 43 #include "core/loader/FrameLoadRequest.h" | 43 #include "core/loader/FrameLoadRequest.h" |
| 44 #include "core/loader/FrameLoader.h" | 44 #include "core/loader/FrameLoader.h" |
| 45 #include "platform/heap/Handle.h" | 45 #include "platform/heap/Handle.h" |
| 46 #include "platform/network/EncodedFormData.h" | 46 #include "platform/network/EncodedFormData.h" |
| 47 #include "platform/network/FormDataEncoder.h" | 47 #include "platform/network/FormDataEncoder.h" |
| 48 #include "wtf/CurrentTime.h" | 48 #include "wtf/CurrentTime.h" |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 AtomicString encodingType = copiedAttributes.encodingType(); | 202 AtomicString encodingType = copiedAttributes.encodingType(); |
| 203 | 203 |
| 204 if (copiedAttributes.method() == PostMethod) { | 204 if (copiedAttributes.method() == PostMethod) { |
| 205 isMultiPartForm = copiedAttributes.isMultiPartForm(); | 205 isMultiPartForm = copiedAttributes.isMultiPartForm(); |
| 206 if (isMultiPartForm && isMailtoForm) { | 206 if (isMultiPartForm && isMailtoForm) { |
| 207 encodingType = AtomicString("application/x-www-form-urlencoded", Ato
micString::ConstructFromLiteral); | 207 encodingType = AtomicString("application/x-www-form-urlencoded", Ato
micString::ConstructFromLiteral); |
| 208 isMultiPartForm = false; | 208 isMultiPartForm = false; |
| 209 } | 209 } |
| 210 } | 210 } |
| 211 WTF::TextEncoding dataEncoding = isMailtoForm ? UTF8Encoding() : FormDataEnc
oder::encodingFromAcceptCharset(copiedAttributes.acceptCharset(), document.chars
et(), document.defaultCharset()); | 211 WTF::TextEncoding dataEncoding = isMailtoForm ? UTF8Encoding() : FormDataEnc
oder::encodingFromAcceptCharset(copiedAttributes.acceptCharset(), document.chars
et(), document.defaultCharset()); |
| 212 DOMFormData* domFormData = DOMFormData::create(dataEncoding.encodingForFormS
ubmission()); | 212 FormData* domFormData = FormData::create(dataEncoding.encodingForFormSubmiss
ion()); |
| 213 | 213 |
| 214 bool containsPasswordData = false; | 214 bool containsPasswordData = false; |
| 215 for (unsigned i = 0; i < form->associatedElements().size(); ++i) { | 215 for (unsigned i = 0; i < form->associatedElements().size(); ++i) { |
| 216 FormAssociatedElement* control = form->associatedElements()[i]; | 216 FormAssociatedElement* control = form->associatedElements()[i]; |
| 217 ASSERT(control); | 217 ASSERT(control); |
| 218 HTMLElement& element = toHTMLElement(*control); | 218 HTMLElement& element = toHTMLElement(*control); |
| 219 if (!element.isDisabledFormControl()) | 219 if (!element.isDisabledFormControl()) |
| 220 control->appendFormData(*domFormData, isMultiPartForm); | 220 control->appendFormData(*domFormData, isMultiPartForm); |
| 221 if (isHTMLInputElement(element)) { | 221 if (isHTMLInputElement(element)) { |
| 222 HTMLInputElement& input = toHTMLInputElement(element); | 222 HTMLInputElement& input = toHTMLInputElement(element); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 if (m_boundary.isEmpty()) | 275 if (m_boundary.isEmpty()) |
| 276 frameRequest.resourceRequest().setHTTPContentType(m_contentType); | 276 frameRequest.resourceRequest().setHTTPContentType(m_contentType); |
| 277 else | 277 else |
| 278 frameRequest.resourceRequest().setHTTPContentType(m_contentType + ";
boundary=" + m_boundary); | 278 frameRequest.resourceRequest().setHTTPContentType(m_contentType + ";
boundary=" + m_boundary); |
| 279 } | 279 } |
| 280 | 280 |
| 281 frameRequest.resourceRequest().setURL(requestURL()); | 281 frameRequest.resourceRequest().setURL(requestURL()); |
| 282 } | 282 } |
| 283 | 283 |
| 284 } | 284 } |
| OLD | NEW |