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

Unified Diff: Source/platform/text/PlatformLocale.cpp

Issue 235273003: parsing input type=number should skip spaces (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: incorporated review comments Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: Source/platform/text/PlatformLocale.cpp
diff --git a/Source/platform/text/PlatformLocale.cpp b/Source/platform/text/PlatformLocale.cpp
index 60acf5a59ba7e7e0b5abb69a3a4ca862ac4f605e..c79c85618633791549c7467bf4dd1612594f2d86 100644
--- a/Source/platform/text/PlatformLocale.cpp
+++ b/Source/platform/text/PlatformLocale.cpp
@@ -348,10 +348,15 @@ unsigned Locale::matchedDecimalSymbolIndex(const String& input, unsigned& positi
return DecimalSymbolsSize;
}
+static bool isSpaceCharacter(UChar c)
+{
+ return c == ' ';
+}
+
String Locale::convertFromLocalizedNumber(const String& localized)
{
initializeLocaleData();
- String input = localized.stripWhiteSpace();
+ String input = localized.removeCharacters(isSpaceCharacter);
tkent 2014/04/16 01:52:51 Let's use isASCIISpace in wtf/ASCIICType.h for sim
gnana 2014/04/16 14:13:56 Done.
if (!m_hasLocaleData || input.isEmpty())
return input;

Powered by Google App Engine
This is Rietveld 408576698