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

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

Issue 1756483005: Option, checkbox and radio should support ':default' selector (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased the patch Created 4 years, 9 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 16 matching lines...) Expand all
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32 #include "core/html/forms/BaseButtonInputType.h" 32 #include "core/html/forms/BaseButtonInputType.h"
33 33
34 #include "core/HTMLNames.h" 34 #include "core/HTMLNames.h"
35 #include "core/dom/Text.h" 35 #include "core/dom/Text.h"
36 #include "core/dom/shadow/ShadowRoot.h" 36 #include "core/dom/shadow/ShadowRoot.h"
37 #include "core/html/HTMLFormElement.h"
37 #include "core/html/HTMLInputElement.h" 38 #include "core/html/HTMLInputElement.h"
38 #include "core/html/parser/HTMLParserIdioms.h" 39 #include "core/html/parser/HTMLParserIdioms.h"
39 #include "core/layout/LayoutButton.h" 40 #include "core/layout/LayoutButton.h"
40 41
41 namespace blink { 42 namespace blink {
42 43
43 using namespace HTMLNames; 44 using namespace HTMLNames;
44 45
45 void BaseButtonInputType::createShadowSubtree() 46 void BaseButtonInputType::createShadowSubtree()
46 { 47 {
(...skipping 28 matching lines...) Expand all
75 bool BaseButtonInputType::storesValueSeparateFromAttribute() 76 bool BaseButtonInputType::storesValueSeparateFromAttribute()
76 { 77 {
77 return false; 78 return false;
78 } 79 }
79 80
80 void BaseButtonInputType::setValue(const String& sanitizedValue, bool, TextField EventBehavior) 81 void BaseButtonInputType::setValue(const String& sanitizedValue, bool, TextField EventBehavior)
81 { 82 {
82 element().setAttribute(valueAttr, AtomicString(sanitizedValue)); 83 element().setAttribute(valueAttr, AtomicString(sanitizedValue));
83 } 84 }
84 85
86 bool BaseButtonInputType::matchesDefaultPseudoClass()
87 {
tkent 2016/03/04 06:39:14 Please copy the comment in HTMLFormControlElement:
ramya.v 2016/03/04 10:22:40 Done.
88 return canBeSuccessfulSubmitButton() && element().form() && element().form() ->defaultButton() == &element();
89 }
90
85 } // namespace blink 91 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698