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

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

Issue 60573007: Non-activated default buttons prevent implicit form submission. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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) 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, 2010 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) 7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 HTMLFormControlElement::defaultEventHandler(event); 152 HTMLFormControlElement::defaultEventHandler(event);
153 } 153 }
154 154
155 bool HTMLButtonElement::willRespondToMouseClickEvents() 155 bool HTMLButtonElement::willRespondToMouseClickEvents()
156 { 156 {
157 if (!isDisabledFormControl() && form() && (m_type == SUBMIT || m_type == RES ET)) 157 if (!isDisabledFormControl() && form() && (m_type == SUBMIT || m_type == RES ET))
158 return true; 158 return true;
159 return HTMLFormControlElement::willRespondToMouseClickEvents(); 159 return HTMLFormControlElement::willRespondToMouseClickEvents();
160 } 160 }
161 161
162 bool HTMLButtonElement::isSuccessfulSubmitButton() const 162 bool HTMLButtonElement::canBeSuccessfulSubmitButton() const
163 { 163 {
164 // HTML spec says that buttons must have names to be considered successful. 164 // HTML spec says that buttons must have names to be considered successful.
eseidel 2013/11/14 16:40:32 Interesting that we're choosing to follow one bit
tkent 2013/11/15 00:04:31 It seems the WHATWG specification doesn't ask it.
sof 2013/11/15 08:52:15 Done. I couldn't find any mention of this either (
165 // However, other browsers do not impose this constraint. 165 // However, other browsers do not impose this constraint.
166 return m_type == SUBMIT && !isDisabledFormControl(); 166 return m_type == SUBMIT;
167 } 167 }
168 168
169 bool HTMLButtonElement::isActivatedSubmit() const 169 bool HTMLButtonElement::isActivatedSubmit() const
170 { 170 {
171 return m_isActivatedSubmit; 171 return m_isActivatedSubmit;
172 } 172 }
173 173
174 void HTMLButtonElement::setActivatedSubmit(bool flag) 174 void HTMLButtonElement::setActivatedSubmit(bool flag)
175 { 175 {
176 m_isActivatedSubmit = flag; 176 m_isActivatedSubmit = flag;
(...skipping 28 matching lines...) Expand all
205 { 205 {
206 return m_type == SUBMIT && HTMLFormControlElement::recalcWillValidate(); 206 return m_type == SUBMIT && HTMLFormControlElement::recalcWillValidate();
207 } 207 }
208 208
209 bool HTMLButtonElement::isInteractiveContent() const 209 bool HTMLButtonElement::isInteractiveContent() const
210 { 210 {
211 return true; 211 return true;
212 } 212 }
213 213
214 } // namespace 214 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698