Title: [115711] trunk
Revision
115711
Author
[email protected]
Date
2012-04-30 20:51:00 -0700 (Mon, 30 Apr 2012)

Log Message

REGRESSION(r115600): parseLocalizedDate() should fail for invalid inputs
https://bugs.webkit.org/show_bug.cgi?id=85176

Reviewed by Kentaro Hara.

Source/WebCore:

Test: fast/forms/date/input-date-commit-valid-only.html

* platform/text/mac/LocalizedDateMac.mm:
(WebCore::parseLocalizedDate):
We should check nil for the result of NSDateFormtter::dateFromString.

LayoutTests:

* platform/chromium/test_expectations.txt: Remove an entry for a fixed test.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (115710 => 115711)


--- trunk/LayoutTests/ChangeLog	2012-05-01 03:27:20 UTC (rev 115710)
+++ trunk/LayoutTests/ChangeLog	2012-05-01 03:51:00 UTC (rev 115711)
@@ -1,3 +1,12 @@
+2012-04-30  Kent Tamura  <[email protected]>
+
+        REGRESSION(r115600): parseLocalizedDate() should fail for invalid inputs
+        https://bugs.webkit.org/show_bug.cgi?id=85176
+
+        Reviewed by Kentaro Hara.
+
+        * platform/chromium/test_expectations.txt: Remove an entry for a fixed test.
+
 2012-04-30  Ilya Sherman  <[email protected]>
 
         Unreviewed, rolling out r113511.

Modified: trunk/LayoutTests/platform/chromium/test_expectations.txt (115710 => 115711)


--- trunk/LayoutTests/platform/chromium/test_expectations.txt	2012-05-01 03:27:20 UTC (rev 115710)
+++ trunk/LayoutTests/platform/chromium/test_expectations.txt	2012-05-01 03:51:00 UTC (rev 115711)
@@ -3715,6 +3715,4 @@
 BUGWK85174 : http/tests/security/filesystem-iframe-from-remote.html = TEXT
 BUGWK85174 : storage/indexeddb/noblobs.html = TEXT
 
-BUGWK85176 MAC : fast/forms/date/input-date-commit-valid-only.html = TEXT
-
 BUGWK85120 : fast/js/toString-number.html = TEXT

Modified: trunk/Source/WebCore/ChangeLog (115710 => 115711)


--- trunk/Source/WebCore/ChangeLog	2012-05-01 03:27:20 UTC (rev 115710)
+++ trunk/Source/WebCore/ChangeLog	2012-05-01 03:51:00 UTC (rev 115711)
@@ -1,3 +1,16 @@
+2012-04-30  Kent Tamura  <[email protected]>
+
+        REGRESSION(r115600): parseLocalizedDate() should fail for invalid inputs
+        https://bugs.webkit.org/show_bug.cgi?id=85176
+
+        Reviewed by Kentaro Hara.
+
+        Test: fast/forms/date/input-date-commit-valid-only.html
+
+        * platform/text/mac/LocalizedDateMac.mm:
+        (WebCore::parseLocalizedDate):
+        We should check nil for the result of NSDateFormtter::dateFromString.
+
 2012-04-30  Mark Rowe  <[email protected]>
 
         Fix another leak due to misuse of createCFString.

Modified: trunk/Source/WebCore/platform/text/mac/LocalizedDateMac.mm (115710 => 115711)


--- trunk/Source/WebCore/platform/text/mac/LocalizedDateMac.mm	2012-05-01 03:27:20 UTC (rev 115710)
+++ trunk/Source/WebCore/platform/text/mac/LocalizedDateMac.mm	2012-05-01 03:51:00 UTC (rev 115711)
@@ -57,7 +57,10 @@
     switch (type) {
     case DateComponents::Date: {
         RetainPtr<NSDateFormatter> formatter(AdoptNS, createShortDateFormatter());
-        return [[formatter.get() dateFromString:input] timeIntervalSince1970] * msPerSecond;
+        NSDate *date = [formatter.get() dateFromString:input];
+        if (!date)
+            break;
+        return [date timeIntervalSince1970] * msPerSecond;
     }
     case DateComponents::DateTime:
     case DateComponents::DateTimeLocal:
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to