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

Unified Diff: third_party/WebKit/Source/platform/DateComponents.cpp

Issue 2678343007: Modify DateComponents::parseTime to reject values with >3 fractional decimal places (Closed)
Patch Set: Updated tests Created 3 years, 10 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/forms/time/time-validity-typemismatch-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/DateComponents.cpp
diff --git a/third_party/WebKit/Source/platform/DateComponents.cpp b/third_party/WebKit/Source/platform/DateComponents.cpp
index 5ad6e0b7dc0985e36e8553bf5603b88fd3848d4f..7176b0ca11481c44bbd8d132dc87c243c917ab4e 100644
--- a/third_party/WebKit/Source/platform/DateComponents.cpp
+++ b/third_party/WebKit/Source/platform/DateComponents.cpp
@@ -447,8 +447,10 @@ bool DateComponents::parseTime(const String& src,
} else if (digitsLength == 2) {
ok = toInt(src, index, 2, millisecond);
millisecond *= 10;
- } else { // digitsLength >= 3
+ } else if (digitsLength == 3) {
ok = toInt(src, index, 3, millisecond);
+ } else { // digitsLength >= 4
+ return false;
}
DCHECK(ok);
index += digitsLength;
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/forms/time/time-validity-typemismatch-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698