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

Unified Diff: third_party/WebKit/Source/core/html/parser/HTMLParserIdioms.cpp

Issue 1378613005: input[type=number] should not accept numbers ending with '.'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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: third_party/WebKit/Source/core/html/parser/HTMLParserIdioms.cpp
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLParserIdioms.cpp b/third_party/WebKit/Source/core/html/parser/HTMLParserIdioms.cpp
index bcab21ac3f46e0c2da6f6670a0dfe911f50805aa..eb108dc9568e4d0f03e88f39ee50ac68c049cc97 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLParserIdioms.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLParserIdioms.cpp
@@ -121,6 +121,8 @@ double parseToDoubleForNumberType(const String& string, double fallbackValue)
UChar firstCharacter = string[0];
if (firstCharacter != '-' && firstCharacter != '.' && !isASCIIDigit(firstCharacter))
return fallbackValue;
+ if (string.endsWith('.'))
+ return fallbackValue;
bool valid = false;
double value = string.toDouble(&valid);
« no previous file with comments | « third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/forms/the-input-element/number-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698