| 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 16 matching lines...) Expand all Loading... |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 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 "core/loader/FormSubmission.h" | 31 #include "core/loader/FormSubmission.h" |
| 32 | 32 |
| 33 #include "core/HTMLNames.h" | 33 #include "core/HTMLNames.h" |
| 34 #include "core/InputTypeNames.h" | 34 #include "core/InputTypeNames.h" |
| 35 #include "core/dom/Document.h" | 35 #include "core/dom/Document.h" |
| 36 #include "core/events/Event.h" | 36 #include "core/events/Event.h" |
| 37 #include "core/frame/UseCounter.h" |
| 37 #include "core/html/FormData.h" | 38 #include "core/html/FormData.h" |
| 38 #include "core/html/HTMLFormControlElement.h" | 39 #include "core/html/HTMLFormControlElement.h" |
| 39 #include "core/html/HTMLFormElement.h" | 40 #include "core/html/HTMLFormElement.h" |
| 40 #include "core/html/HTMLInputElement.h" | 41 #include "core/html/HTMLInputElement.h" |
| 41 #include "core/html/parser/HTMLParserIdioms.h" | 42 #include "core/html/parser/HTMLParserIdioms.h" |
| 42 #include "core/loader/FrameLoadRequest.h" | 43 #include "core/loader/FrameLoadRequest.h" |
| 43 #include "core/loader/FrameLoader.h" | 44 #include "core/loader/FrameLoader.h" |
| 44 #include "platform/heap/Handle.h" | 45 #include "platform/heap/Handle.h" |
| 45 #include "platform/network/EncodedFormData.h" | 46 #include "platform/network/EncodedFormData.h" |
| 46 #include "platform/network/FormDataEncoder.h" | 47 #include "platform/network/FormDataEncoder.h" |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 } | 190 } |
| 190 | 191 |
| 191 if (copiedAttributes.method() == DialogMethod) { | 192 if (copiedAttributes.method() == DialogMethod) { |
| 192 if (submitButton) | 193 if (submitButton) |
| 193 return new FormSubmission(submitButton->resultForDialogSubmit()); | 194 return new FormSubmission(submitButton->resultForDialogSubmit()); |
| 194 return new FormSubmission(""); | 195 return new FormSubmission(""); |
| 195 } | 196 } |
| 196 | 197 |
| 197 Document& document = form->document(); | 198 Document& document = form->document(); |
| 198 KURL actionURL = document.completeURL(copiedAttributes.action().isEmpty() ?
document.url().getString() : copiedAttributes.action()); | 199 KURL actionURL = document.completeURL(copiedAttributes.action().isEmpty() ?
document.url().getString() : copiedAttributes.action()); |
| 200 |
| 201 if (document.getInsecureRequestsPolicy() == SecurityContext::InsecureRequest
sUpgrade && actionURL.protocolIs("http")) { |
| 202 UseCounter::count(document, UseCounter::UpgradeInsecureRequestsUpgradedR
equest); |
| 203 actionURL.setProtocol("https"); |
| 204 if (actionURL.port() == 80) |
| 205 actionURL.setPort(443); |
| 206 } |
| 207 |
| 199 bool isMailtoForm = actionURL.protocolIs("mailto"); | 208 bool isMailtoForm = actionURL.protocolIs("mailto"); |
| 200 bool isMultiPartForm = false; | 209 bool isMultiPartForm = false; |
| 201 AtomicString encodingType = copiedAttributes.encodingType(); | 210 AtomicString encodingType = copiedAttributes.encodingType(); |
| 202 | 211 |
| 203 if (copiedAttributes.method() == PostMethod) { | 212 if (copiedAttributes.method() == PostMethod) { |
| 204 isMultiPartForm = copiedAttributes.isMultiPartForm(); | 213 isMultiPartForm = copiedAttributes.isMultiPartForm(); |
| 205 if (isMultiPartForm && isMailtoForm) { | 214 if (isMultiPartForm && isMailtoForm) { |
| 206 encodingType = AtomicString("application/x-www-form-urlencoded"); | 215 encodingType = AtomicString("application/x-www-form-urlencoded"); |
| 207 isMultiPartForm = false; | 216 isMultiPartForm = false; |
| 208 } | 217 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 if (m_boundary.isEmpty()) | 283 if (m_boundary.isEmpty()) |
| 275 frameRequest.resourceRequest().setHTTPContentType(m_contentType); | 284 frameRequest.resourceRequest().setHTTPContentType(m_contentType); |
| 276 else | 285 else |
| 277 frameRequest.resourceRequest().setHTTPContentType(m_contentType + ";
boundary=" + m_boundary); | 286 frameRequest.resourceRequest().setHTTPContentType(m_contentType + ";
boundary=" + m_boundary); |
| 278 } | 287 } |
| 279 | 288 |
| 280 frameRequest.resourceRequest().setURL(requestURL()); | 289 frameRequest.resourceRequest().setURL(requestURL()); |
| 281 } | 290 } |
| 282 | 291 |
| 283 } // namespace blink | 292 } // namespace blink |
| OLD | NEW |