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

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

Issue 17381010: Introduce toHTMLFormControlElement, and use it. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/RadioNodeList.cpp ('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 } 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
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 }
OLDNEW
« no previous file with comments | « Source/core/html/RadioNodeList.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698