| 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 formData = FormData::create(*(static_cast<FormDataList*>(domFormData.get
())), domFormData->encoding(), attributes.method() == GetMethod ? FormData::Form
URLEncoded : FormData::parseEncodingType(encodingType)); | 205 formData = FormData::create(*(static_cast<FormDataList*>(domFormData.get
())), domFormData->encoding(), attributes.method() == GetMethod ? FormData::Form
URLEncoded : FormData::parseEncodingType(encodingType)); |
| 206 if (copiedAttributes.method() == PostMethod && isMailtoForm) { | 206 if (copiedAttributes.method() == PostMethod && isMailtoForm) { |
| 207 // Convert the form data into a string that we put into the URL. | 207 // Convert the form data into a string that we put into the URL. |
| 208 appendMailtoPostFormDataToURL(actionURL, *formData, encodingType); | 208 appendMailtoPostFormDataToURL(actionURL, *formData, encodingType); |
| 209 formData = FormData::create(); | 209 formData = FormData::create(); |
| 210 } | 210 } |
| 211 } | 211 } |
| 212 | 212 |
| 213 formData->setIdentifier(generateFormDataIdentifier()); | 213 formData->setIdentifier(generateFormDataIdentifier()); |
| 214 String targetOrBaseTarget = copiedAttributes.target().isEmpty() ? document->
baseTarget() : copiedAttributes.target(); | 214 String targetOrBaseTarget = copiedAttributes.target().isEmpty() ? document->
baseTarget() : copiedAttributes.target(); |
| 215 RefPtr<FormState> formState = FormState::create(form, formValues, document->
frame(), trigger); | 215 RefPtr<FormState> formState = FormState::create(form, formValues, document,
trigger); |
| 216 return adoptRef(new FormSubmission(copiedAttributes.method(), actionURL, tar
getOrBaseTarget, encodingType, formState.release(), formData.release(), boundary
, lockHistory, event)); | 216 return adoptRef(new FormSubmission(copiedAttributes.method(), actionURL, tar
getOrBaseTarget, encodingType, formState.release(), formData.release(), boundary
, lockHistory, event)); |
| 217 } | 217 } |
| 218 | 218 |
| 219 KURL FormSubmission::requestURL() const | 219 KURL FormSubmission::requestURL() const |
| 220 { | 220 { |
| 221 if (m_method == FormSubmission::PostMethod) | 221 if (m_method == FormSubmission::PostMethod) |
| 222 return m_action; | 222 return m_action; |
| 223 | 223 |
| 224 KURL requestURL(m_action); | 224 KURL requestURL(m_action); |
| 225 requestURL.setQuery(m_formData->flattenToString()); | 225 requestURL.setQuery(m_formData->flattenToString()); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 243 frameRequest.resourceRequest().setHTTPContentType(m_contentType); | 243 frameRequest.resourceRequest().setHTTPContentType(m_contentType); |
| 244 else // contentType must be "multipart/form-data" | 244 else // contentType must be "multipart/form-data" |
| 245 frameRequest.resourceRequest().setHTTPContentType(m_contentType + ";
boundary=" + m_boundary); | 245 frameRequest.resourceRequest().setHTTPContentType(m_contentType + ";
boundary=" + m_boundary); |
| 246 } | 246 } |
| 247 | 247 |
| 248 frameRequest.resourceRequest().setURL(requestURL()); | 248 frameRequest.resourceRequest().setURL(requestURL()); |
| 249 FrameLoader::addHTTPOriginIfNeeded(frameRequest.resourceRequest(), m_origin)
; | 249 FrameLoader::addHTTPOriginIfNeeded(frameRequest.resourceRequest(), m_origin)
; |
| 250 } | 250 } |
| 251 | 251 |
| 252 } | 252 } |
| OLD | NEW |