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

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

Issue 171603007: Allow form submission for forms with "hidden" for submit with enter key (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Missing text expectation file added Created 6 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/platform/win/fast/forms/implicit-submission-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) 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 const Vector<FormAssociatedElement*>& elements = associatedElements(); 195 const Vector<FormAssociatedElement*>& elements = associatedElements();
196 for (unsigned i = 0; i < elements.size(); ++i) { 196 for (unsigned i = 0; i < elements.size(); ++i) {
197 FormAssociatedElement* formAssociatedElement = elements[i]; 197 FormAssociatedElement* formAssociatedElement = elements[i];
198 if (!formAssociatedElement->isFormControlElement()) 198 if (!formAssociatedElement->isFormControlElement())
199 continue; 199 continue;
200 HTMLFormControlElement* control = toHTMLFormControlElement(formAssociate dElement); 200 HTMLFormControlElement* control = toHTMLFormControlElement(formAssociate dElement);
201 if (!seenDefaultButton && control->canBeSuccessfulSubmitButton()) { 201 if (!seenDefaultButton && control->canBeSuccessfulSubmitButton()) {
202 if (fromImplicitSubmissionTrigger) 202 if (fromImplicitSubmissionTrigger)
203 seenDefaultButton = true; 203 seenDefaultButton = true;
204 if (control->isSuccessfulSubmitButton()) { 204 if (control->isSuccessfulSubmitButton()) {
205 if (control->renderer()) { 205 control->dispatchSimulatedClick(event);
206 control->dispatchSimulatedClick(event); 206 return;
207 return;
208 }
209 } else if (fromImplicitSubmissionTrigger) { 207 } else if (fromImplicitSubmissionTrigger) {
210 // Default (submit) button is not activated; no implicit submiss ion. 208 // Default (submit) button is not activated; no implicit submiss ion.
211 return; 209 return;
212 } 210 }
213 } else if (control->canTriggerImplicitSubmission()) { 211 } else if (control->canTriggerImplicitSubmission()) {
214 ++submissionTriggerCount; 212 ++submissionTriggerCount;
215 } 213 }
216 } 214 }
217 if (fromImplicitSubmissionTrigger && submissionTriggerCount == 1) 215 if (fromImplicitSubmissionTrigger && submissionTriggerCount == 1)
218 prepareForSubmission(event); 216 prepareForSubmission(event);
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 } 815 }
818 816
819 void HTMLFormElement::setDemoted(bool demoted) 817 void HTMLFormElement::setDemoted(bool demoted)
820 { 818 {
821 if (demoted) 819 if (demoted)
822 UseCounter::count(document(), UseCounter::DemotedFormElement); 820 UseCounter::count(document(), UseCounter::DemotedFormElement);
823 m_wasDemoted = demoted; 821 m_wasDemoted = demoted;
824 } 822 }
825 823
826 } // namespace 824 } // namespace
OLDNEW
« no previous file with comments | « LayoutTests/platform/win/fast/forms/implicit-submission-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698