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

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

Issue 9369055: Merge 106771 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 10 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
« no previous file with comments | « LayoutTests/fast/forms/form-submission-create-crash-expected.txt ('k') | no next file » | 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 , m_lockHistory(lockHistory) 135 , m_lockHistory(lockHistory)
136 , m_event(event) 136 , m_event(event)
137 { 137 {
138 } 138 }
139 139
140 PassRefPtr<FormSubmission> FormSubmission::create(HTMLFormElement* form, const A ttributes& attributes, PassRefPtr<Event> event, bool lockHistory, FormSubmission Trigger trigger) 140 PassRefPtr<FormSubmission> FormSubmission::create(HTMLFormElement* form, const A ttributes& attributes, PassRefPtr<Event> event, bool lockHistory, FormSubmission Trigger trigger)
141 { 141 {
142 ASSERT(form); 142 ASSERT(form);
143 143
144 HTMLFormControlElement* submitButton = 0; 144 HTMLFormControlElement* submitButton = 0;
145 if (event && event->target() && event->target()->toNode()) 145 if (event && event->target()) {
146 submitButton = static_cast<HTMLFormControlElement*>(event->target()->toN ode()); 146 Node* node = event->target()->toNode();
147 if (node && node->isElementNode() && toElement(node)->isFormControlEleme nt())
148 submitButton = static_cast<HTMLFormControlElement*>(node);
149 }
147 150
148 FormSubmission::Attributes copiedAttributes; 151 FormSubmission::Attributes copiedAttributes;
149 copiedAttributes.copyFrom(attributes); 152 copiedAttributes.copyFrom(attributes);
150 if (submitButton) { 153 if (submitButton) {
151 String attributeValue; 154 String attributeValue;
152 if (!(attributeValue = submitButton->getAttribute(formactionAttr)).isNul l()) 155 if (!(attributeValue = submitButton->getAttribute(formactionAttr)).isNul l())
153 copiedAttributes.parseAction(attributeValue); 156 copiedAttributes.parseAction(attributeValue);
154 if (!(attributeValue = submitButton->getAttribute(formenctypeAttr)).isNu ll()) 157 if (!(attributeValue = submitButton->getAttribute(formenctypeAttr)).isNu ll())
155 copiedAttributes.updateEncodingType(attributeValue); 158 copiedAttributes.updateEncodingType(attributeValue);
156 if (!(attributeValue = submitButton->getAttribute(formmethodAttr)).isNul l()) 159 if (!(attributeValue = submitButton->getAttribute(formmethodAttr)).isNul l())
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 frameRequest.resourceRequest().setHTTPContentType(m_contentType); 243 frameRequest.resourceRequest().setHTTPContentType(m_contentType);
241 else // contentType must be "multipart/form-data" 244 else // contentType must be "multipart/form-data"
242 frameRequest.resourceRequest().setHTTPContentType(m_contentType + "; boundary=" + m_boundary); 245 frameRequest.resourceRequest().setHTTPContentType(m_contentType + "; boundary=" + m_boundary);
243 } 246 }
244 247
245 frameRequest.resourceRequest().setURL(requestURL()); 248 frameRequest.resourceRequest().setURL(requestURL());
246 FrameLoader::addHTTPOriginIfNeeded(frameRequest.resourceRequest(), m_origin) ; 249 FrameLoader::addHTTPOriginIfNeeded(frameRequest.resourceRequest(), m_origin) ;
247 } 250 }
248 251
249 } 252 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/forms/form-submission-create-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698