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

Side by Side Diff: third_party/WebKit/Source/core/html/forms/SubmitInputType.cpp

Issue 2340213002: submit() in submit event handler should not contains a value of a submit button. (Closed)
Patch Set: Created 4 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 bool SubmitInputType::supportsRequired() const 60 bool SubmitInputType::supportsRequired() const
61 { 61 {
62 return false; 62 return false;
63 } 63 }
64 64
65 void SubmitInputType::handleDOMActivateEvent(Event* event) 65 void SubmitInputType::handleDOMActivateEvent(Event* event)
66 { 66 {
67 if (element().isDisabledFormControl() || !element().form()) 67 if (element().isDisabledFormControl() || !element().form())
68 return; 68 return;
69 element().setActivatedSubmit(true); 69 element().form()->prepareForSubmission(event, &element()); // Event handlers can run.
70 element().form()->prepareForSubmission(event); // Event handlers can run.
71 element().setActivatedSubmit(false);
72 event->setDefaultHandled(); 70 event->setDefaultHandled();
73 } 71 }
74 72
75 bool SubmitInputType::canBeSuccessfulSubmitButton() 73 bool SubmitInputType::canBeSuccessfulSubmitButton()
76 { 74 {
77 return true; 75 return true;
78 } 76 }
79 77
80 String SubmitInputType::defaultValue() const 78 String SubmitInputType::defaultValue() const
81 { 79 {
82 return locale().queryString(WebLocalizedString::SubmitButtonDefaultLabel); 80 return locale().queryString(WebLocalizedString::SubmitButtonDefaultLabel);
83 } 81 }
84 82
85 bool SubmitInputType::isTextButton() const 83 bool SubmitInputType::isTextButton() const
86 { 84 {
87 return true; 85 return true;
88 } 86 }
89 87
90 void SubmitInputType::valueAttributeChanged() 88 void SubmitInputType::valueAttributeChanged()
91 { 89 {
92 UseCounter::count(element().document(), UseCounter::InputTypeSubmitWithValue ); 90 UseCounter::count(element().document(), UseCounter::InputTypeSubmitWithValue );
93 BaseButtonInputType::valueAttributeChanged(); 91 BaseButtonInputType::valueAttributeChanged();
94 } 92 }
95 93
96 } // namespace blink 94 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/forms/ImageInputType.cpp ('k') | third_party/WebKit/Source/core/loader/FormSubmission.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698