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

Side by Side Diff: Source/WebCore/html/NumberInputType.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/NumberInputType.h ('k') | Source/WebCore/html/RangeInputType.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 * 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 return visibleValue; 301 return visibleValue;
302 double parsedNumber = parseLocalizedNumber(visibleValue); 302 double parsedNumber = parseLocalizedNumber(visibleValue);
303 return isfinite(parsedNumber) ? serializeForNumberType(parsedNumber) : visib leValue; 303 return isfinite(parsedNumber) ? serializeForNumberType(parsedNumber) : visib leValue;
304 } 304 }
305 305
306 bool NumberInputType::isAcceptableValue(const String& proposedValue) 306 bool NumberInputType::isAcceptableValue(const String& proposedValue)
307 { 307 {
308 return proposedValue.isEmpty() || isfinite(parseLocalizedNumber(proposedValu e)) || parseToDoubleForNumberType(proposedValue, 0); 308 return proposedValue.isEmpty() || isfinite(parseLocalizedNumber(proposedValu e)) || parseToDoubleForNumberType(proposedValue, 0);
309 } 309 }
310 310
311 String NumberInputType::sanitizeValue(const String& proposedValue) 311 String NumberInputType::sanitizeValue(const String& proposedValue) const
312 { 312 {
313 if (proposedValue.isEmpty()) 313 if (proposedValue.isEmpty())
314 return proposedValue; 314 return proposedValue;
315 return parseToDoubleForNumberType(proposedValue, 0) ? proposedValue : emptyA tom.string(); 315 return parseToDoubleForNumberType(proposedValue, 0) ? proposedValue : emptyA tom.string();
316 } 316 }
317 317
318 bool NumberInputType::hasUnacceptableValue() 318 bool NumberInputType::hasUnacceptableValue()
319 { 319 {
320 return element()->renderer() && !isAcceptableValue(element()->innerTextValue ()); 320 return element()->renderer() && !isAcceptableValue(element()->innerTextValue ());
321 } 321 }
(...skipping 23 matching lines...) Expand all
345 345
346 void NumberInputType::stepAttributeChanged() 346 void NumberInputType::stepAttributeChanged()
347 { 347 {
348 InputType::stepAttributeChanged(); 348 InputType::stepAttributeChanged();
349 349
350 if (element()->renderer()) 350 if (element()->renderer())
351 element()->renderer()->setNeedsLayoutAndPrefWidthsRecalc(); 351 element()->renderer()->setNeedsLayoutAndPrefWidthsRecalc();
352 } 352 }
353 353
354 } // namespace WebCore 354 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebCore/html/NumberInputType.h ('k') | Source/WebCore/html/RangeInputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698