Title: [135355] trunk
Revision
135355
Author
commit-qu...@webkit.org
Date
2012-11-21 00:23:54 -0800 (Wed, 21 Nov 2012)

Log Message

Enable datalist UI for input types datetime and datetime-local
https://bugs.webkit.org/show_bug.cgi?id=102882

Patch by Kunihiko Sakamoto <ksakam...@chromium.org> on 2012-11-21
Reviewed by Kent Tamura.

Source/WebCore:

Enabling datalist UI for input types datetime and datetime-local.

No new tests yet. Tests will be added later in Bug 102888.

* platform/text/PlatformLocale.cpp:
(WebCore::Locale::formatDateTime): Support datetime and datetime-local types.
* rendering/RenderThemeChromiumCommon.cpp:
(WebCore::RenderThemeChromiumCommon::supportsDataListUI): Add datetime and datetimelocal to the list.

LayoutTests:

Removed expectation of failure.

* platform/chromium/fast/forms/datalist/input-list-expected.txt: Removed.

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (135354 => 135355)


--- trunk/LayoutTests/ChangeLog	2012-11-21 06:50:18 UTC (rev 135354)
+++ trunk/LayoutTests/ChangeLog	2012-11-21 08:23:54 UTC (rev 135355)
@@ -1,3 +1,14 @@
+2012-11-21  Kunihiko Sakamoto  <ksakam...@chromium.org>
+
+        Enable datalist UI for input types datetime and datetime-local
+        https://bugs.webkit.org/show_bug.cgi?id=102882
+
+        Reviewed by Kent Tamura.
+
+        Removed expectation of failure.
+
+        * platform/chromium/fast/forms/datalist/input-list-expected.txt: Removed.
+
 2012-11-20  Yury Semikhatsky  <yu...@chromium.org>
 
         Unreviewed. Fixed webkit_lint complaints about overlapping entries in Chromium TestExpectations.

Deleted: trunk/LayoutTests/platform/chromium/fast/forms/datalist/input-list-expected.txt (135354 => 135355)


--- trunk/LayoutTests/platform/chromium/fast/forms/datalist/input-list-expected.txt	2012-11-21 06:50:18 UTC (rev 135354)
+++ trunk/LayoutTests/platform/chromium/fast/forms/datalist/input-list-expected.txt	2012-11-21 08:23:54 UTC (rev 135355)
@@ -1,36 +0,0 @@
-Test for the list attribute.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS input.list is null
-PASS input.list is null
-PASS input.list is null
-PASS datalist.className is "former"
-PASS document.getElementById("text").list is document.getElementById("dl1")
-PASS document.getElementById("search").list is document.getElementById("dl1")
-PASS document.getElementById("url").list is document.getElementById("dl1")
-PASS document.getElementById("telephone").list is document.getElementById("dl1")
-PASS document.getElementById("email").list is document.getElementById("dl1")
-FAIL document.getElementById("datetime").list should be [object HTMLDataListElement]. Was null.
-PASS document.getElementById("date").list is document.getElementById("dl1")
-PASS document.getElementById("month").list is document.getElementById("dl1")
-PASS document.getElementById("week").list is document.getElementById("dl1")
-PASS document.getElementById("time").list is document.getElementById("dl1")
-FAIL document.getElementById("datetime-local").list should be [object HTMLDataListElement]. Was null.
-PASS document.getElementById("number").list is document.getElementById("dl1")
-PASS document.getElementById("range").list is document.getElementById("dl1")
-PASS document.getElementById("color").list is document.getElementById("dl1")
-PASS document.getElementById("hidden").list is null
-PASS document.getElementById("password").list is null
-PASS document.getElementById("checkbox").list is null
-PASS document.getElementById("radio").list is null
-PASS document.getElementById("file").list is null
-PASS document.getElementById("submit").list is null
-PASS document.getElementById("image").list is null
-PASS document.getElementById("reset").list is null
-PASS document.getElementById("button").list is null
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Modified: trunk/Source/WebCore/ChangeLog (135354 => 135355)


--- trunk/Source/WebCore/ChangeLog	2012-11-21 06:50:18 UTC (rev 135354)
+++ trunk/Source/WebCore/ChangeLog	2012-11-21 08:23:54 UTC (rev 135355)
@@ -1,3 +1,19 @@
+2012-11-21  Kunihiko Sakamoto  <ksakam...@chromium.org>
+
+        Enable datalist UI for input types datetime and datetime-local
+        https://bugs.webkit.org/show_bug.cgi?id=102882
+
+        Reviewed by Kent Tamura.
+
+        Enabling datalist UI for input types datetime and datetime-local.
+
+        No new tests yet. Tests will be added later in Bug 102888.
+
+        * platform/text/PlatformLocale.cpp:
+        (WebCore::Locale::formatDateTime): Support datetime and datetime-local types.
+        * rendering/RenderThemeChromiumCommon.cpp:
+        (WebCore::RenderThemeChromiumCommon::supportsDataListUI): Add datetime and datetimelocal to the list.
+
 2012-11-20  Kentaro Hara  <hara...@chromium.org>
 
         [V8] Remove v8/custom/V8XMLHttpRequestConstructor.cpp

Modified: trunk/Source/WebCore/platform/text/PlatformLocale.cpp (135354 => 135355)


--- trunk/Source/WebCore/platform/text/PlatformLocale.cpp	2012-11-21 06:50:18 UTC (rev 135354)
+++ trunk/Source/WebCore/platform/text/PlatformLocale.cpp	2012-11-21 08:23:54 UTC (rev 135355)
@@ -341,13 +341,12 @@
 
 String Locale::formatDateTime(const DateComponents& date, FormatType formatType)
 {
-    if (date.type() == DateComponents::DateTime || date.type() == DateComponents::DateTimeLocal || date.type() == DateComponents::Invalid)
+    if (date.type() == DateComponents::Invalid)
         return String();
 #if !ENABLE(INPUT_TYPE_WEEK)
     if (date.type() == DateComponents::Week)
         return String();
 #endif
-    // FIXME: Supports all types.
 
     DateTimeStringBuilder builder(*this, date);
     switch (date.type()) {
@@ -365,9 +364,11 @@
         builder.build(weekFormatInLDML());
         break;
 #endif
-    case DateComponents::Invalid:
     case DateComponents::DateTime:
     case DateComponents::DateTimeLocal:
+        builder.build(formatType == FormatTypeShort ? dateTimeFormatWithoutSeconds() : dateTimeFormatWithSeconds());
+        break;
+    case DateComponents::Invalid:
         ASSERT_NOT_REACHED();
         break;
     }

Modified: trunk/Source/WebCore/rendering/RenderThemeChromiumCommon.cpp (135354 => 135355)


--- trunk/Source/WebCore/rendering/RenderThemeChromiumCommon.cpp	2012-11-21 06:50:18 UTC (rev 135354)
+++ trunk/Source/WebCore/rendering/RenderThemeChromiumCommon.cpp	2012-11-21 08:23:54 UTC (rev 135355)
@@ -33,7 +33,6 @@
 
 bool RenderThemeChromiumCommon::supportsDataListUI(const AtomicString& type)
 {
-    // FIXME: We still need to support datetime, date, month, week, time, datetime-local.
     return type == InputTypeNames::text() || type == InputTypeNames::search() || type == InputTypeNames::url()
         || type == InputTypeNames::telephone() || type == InputTypeNames::email() || type == InputTypeNames::number()
 #if ENABLE(INPUT_TYPE_COLOR)
@@ -42,6 +41,8 @@
 #if ENABLE(CALENDAR_PICKER)
         || type == InputTypeNames::date()
 #endif
+        || type == InputTypeNames::datetime()
+        || type == InputTypeNames::datetimelocal()
         || type == InputTypeNames::month()
         || type == InputTypeNames::week()
         || type == InputTypeNames::time()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to