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

Side by Side Diff: Source/WebCore/html/ColorInputType.cpp

Issue 8336009: Merge 97351 - REGRESSION(r89915): <input type=email multiple> don't show the default value (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 years, 2 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 | « Source/WebCore/html/ColorInputType.h ('k') | Source/WebCore/html/EmailInputType.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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 bool ColorInputType::supportsRequired() const 82 bool ColorInputType::supportsRequired() const
83 { 83 {
84 return false; 84 return false;
85 } 85 }
86 86
87 String ColorInputType::fallbackValue() 87 String ColorInputType::fallbackValue()
88 { 88 {
89 return String("#000000"); 89 return String("#000000");
90 } 90 }
91 91
92 String ColorInputType::sanitizeValue(const String& proposedValue) 92 String ColorInputType::sanitizeValue(const String& proposedValue) const
93 { 93 {
94 if (proposedValue.isNull())
95 return proposedValue;
96
97 if (!isValidColorString(proposedValue)) 94 if (!isValidColorString(proposedValue))
98 return fallbackValue(); 95 return fallbackValue();
99 96
100 return proposedValue.lower(); 97 return proposedValue.lower();
101 } 98 }
102 99
103 Color ColorInputType::valueAsColor() const 100 Color ColorInputType::valueAsColor() const
104 { 101 {
105 return Color(element()->value()); 102 return Color(element()->value());
106 } 103 }
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 196
200 HTMLElement* ColorInputType::shadowColorSwatch() const 197 HTMLElement* ColorInputType::shadowColorSwatch() const
201 { 198 {
202 ShadowRoot* shadow = element()->shadowRoot(); 199 ShadowRoot* shadow = element()->shadowRoot();
203 return shadow ? toHTMLElement(shadow->firstChild()->firstChild()) : 0; 200 return shadow ? toHTMLElement(shadow->firstChild()->firstChild()) : 0;
204 } 201 }
205 202
206 } // namespace WebCore 203 } // namespace WebCore
207 204
208 #endif // ENABLE(INPUT_COLOR) 205 #endif // ENABLE(INPUT_COLOR)
OLDNEW
« no previous file with comments | « Source/WebCore/html/ColorInputType.h ('k') | Source/WebCore/html/EmailInputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698