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

Side by Side Diff: Source/core/html/HTMLFormElement.cpp

Issue 16081007: Introduce toHTMLInputElement(Node*), and use it. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/HTMLFormControlElement.cpp ('k') | Source/core/html/HTMLInputElement.h » ('j') | 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 } 303 }
304 304
305 void HTMLFormElement::getTextFieldValues(StringPairVector& fieldNamesAndValues) const 305 void HTMLFormElement::getTextFieldValues(StringPairVector& fieldNamesAndValues) const
306 { 306 {
307 ASSERT_ARG(fieldNamesAndValues, fieldNamesAndValues.isEmpty()); 307 ASSERT_ARG(fieldNamesAndValues, fieldNamesAndValues.isEmpty());
308 308
309 fieldNamesAndValues.reserveCapacity(m_associatedElements.size()); 309 fieldNamesAndValues.reserveCapacity(m_associatedElements.size());
310 for (unsigned i = 0; i < m_associatedElements.size(); ++i) { 310 for (unsigned i = 0; i < m_associatedElements.size(); ++i) {
311 FormAssociatedElement* control = m_associatedElements[i]; 311 FormAssociatedElement* control = m_associatedElements[i];
312 HTMLElement* element = toHTMLElement(control); 312 HTMLElement* element = toHTMLElement(control);
313 if (!element->hasLocalName(inputTag)) 313 if (!element->hasTagName(inputTag))
314 continue; 314 continue;
315 315
316 HTMLInputElement* input = static_cast<HTMLInputElement*>(control); 316 HTMLInputElement* input = toHTMLInputElement(element);
317 if (!input->isTextField()) 317 if (!input->isTextField())
318 continue; 318 continue;
319 319
320 fieldNamesAndValues.append(make_pair(input->name().string(), input->valu e())); 320 fieldNamesAndValues.append(make_pair(input->name().string(), input->valu e()));
321 } 321 }
322 } 322 }
323 323
324 void HTMLFormElement::submit(Event* event, bool activateSubmitButton, bool proce ssingUserGesture, FormSubmissionTrigger formSubmissionTrigger) 324 void HTMLFormElement::submit(Event* event, bool activateSubmitButton, bool proce ssingUserGesture, FormSubmissionTrigger formSubmissionTrigger)
325 { 325 {
326 FrameView* view = document()->view(); 326 FrameView* view = document()->view();
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 returnValue1Enabled = true; 730 returnValue1Enabled = true;
731 returnValue1 = elements.at(0); 731 returnValue1 = elements.at(0);
732 return; 732 return;
733 } 733 }
734 734
735 returnValue0Enabled = true; 735 returnValue0Enabled = true;
736 returnValue0 = NamedNodesCollection::create(elements); 736 returnValue0 = NamedNodesCollection::create(elements);
737 } 737 }
738 738
739 } // namespace 739 } // namespace
OLDNEW
« no previous file with comments | « Source/core/html/HTMLFormControlElement.cpp ('k') | Source/core/html/HTMLInputElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698