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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 } | 135 } |
136 | 136 |
137 PassRefPtr<FormSubmission> FormSubmission::create(HTMLFormElement* form, const A
ttributes& attributes, PassRefPtr<Event> event, FormSubmissionTrigger trigger) | 137 PassRefPtr<FormSubmission> FormSubmission::create(HTMLFormElement* form, const A
ttributes& attributes, PassRefPtr<Event> event, FormSubmissionTrigger trigger) |
138 { | 138 { |
139 ASSERT(form); | 139 ASSERT(form); |
140 | 140 |
141 HTMLFormControlElement* submitButton = 0; | 141 HTMLFormControlElement* submitButton = 0; |
142 if (event && event->target()) { | 142 if (event && event->target()) { |
143 for (Node* node = event->target()->toNode(); node; node = node->parentNo
de()) { | 143 for (Node* node = event->target()->toNode(); node; node = node->parentNo
de()) { |
144 if (node->isElementNode() && toElement(node)->isFormControlElement()
) { | 144 if (node->isElementNode() && toElement(node)->isFormControlElement()
) { |
145 submitButton = static_cast<HTMLFormControlElement*>(node); | 145 submitButton = toHTMLFormControlElement(node); |
146 break; | 146 break; |
147 } | 147 } |
148 } | 148 } |
149 } | 149 } |
150 | 150 |
151 FormSubmission::Attributes copiedAttributes; | 151 FormSubmission::Attributes copiedAttributes; |
152 copiedAttributes.copyFrom(attributes); | 152 copiedAttributes.copyFrom(attributes); |
153 if (submitButton) { | 153 if (submitButton) { |
154 String attributeValue; | 154 String attributeValue; |
155 if (!(attributeValue = submitButton->getAttribute(formactionAttr)).isNul
l()) | 155 if (!(attributeValue = submitButton->getAttribute(formactionAttr)).isNul
l()) |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } |
OLD | NEW |