Title: [136803] trunk
Revision
136803
Author
tk...@chromium.org
Date
2012-12-05 22:16:37 -0800 (Wed, 05 Dec 2012)

Log Message

Source/WebCore: INPUT_MULTIPLE_FIELDS_UI: The hour, am/pm, millisecond fields should support read-only state correctly
https://bugs.webkit.org/show_bug.cgi?id=104210

Reviewed by Kentaro Hara.

1. The hour, am/pm, and millisecond fields should have CSS rules for
   [readonly]. They should be gray when they are read-only.
2. The am/pm field should reject to set an empty value like other
   numeric fields do.

Tests: Add test cases to fast/forms/time/time-appearance-basic.html.

* css/html.css: merge existing readonly rules, and add ampm, hour, and
millisecond pseudo classes.
* html/shadow/DateTimeSymbolicFieldElement.cpp:
(WebCore::DateTimeSymbolicFieldElement::setEmptyValue):
Reject to set empty value if it is read-only.

LayoutTests: INPUT_MULTIPLE_FIELDS_UI: The hour field and the am/pm field should support read-only state correctly
https://bugs.webkit.org/show_bug.cgi?id=104210

Reviewed by Kentaro Hara.

* fast/forms/time/time-appearance-basic.html:
Add test cases for step=86400 (24 hours)
* platform/chromium-mac/fast/forms/time/time-appearance-basic-expected.png:
* platform/chromium/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (136802 => 136803)


--- trunk/LayoutTests/ChangeLog	2012-12-06 06:09:54 UTC (rev 136802)
+++ trunk/LayoutTests/ChangeLog	2012-12-06 06:16:37 UTC (rev 136803)
@@ -1,3 +1,15 @@
+2012-12-05  Kent Tamura  <tk...@chromium.org>
+
+        INPUT_MULTIPLE_FIELDS_UI: The hour field and the am/pm field should support read-only state correctly
+        https://bugs.webkit.org/show_bug.cgi?id=104210
+
+        Reviewed by Kentaro Hara.
+
+        * fast/forms/time/time-appearance-basic.html:
+        Add test cases for step=86400 (24 hours)
+        * platform/chromium-mac/fast/forms/time/time-appearance-basic-expected.png:
+        * platform/chromium/TestExpectations:
+
 2012-12-05  Dan Beam  <db...@chromium.org>
 
         HTMLFormElement#requestAutocomplete() should require a user action

Modified: trunk/LayoutTests/fast/forms/time/time-appearance-basic-expected.txt (136802 => 136803)


--- trunk/LayoutTests/fast/forms/time/time-appearance-basic-expected.txt	2012-12-06 06:09:54 UTC (rev 136802)
+++ trunk/LayoutTests/fast/forms/time/time-appearance-basic-expected.txt	2012-12-06 06:16:37 UTC (rev 136803)
@@ -3,6 +3,7 @@
 step=0.0001  
 step=60  
 step=3600  
+step=86400  
 step mismatched  
 RTL 
 Disabled, step=3600  

Modified: trunk/LayoutTests/fast/forms/time/time-appearance-basic.html (136802 => 136803)


--- trunk/LayoutTests/fast/forms/time/time-appearance-basic.html	2012-12-06 06:09:54 UTC (rev 136802)
+++ trunk/LayoutTests/fast/forms/time/time-appearance-basic.html	2012-12-06 06:16:37 UTC (rev 136803)
@@ -10,6 +10,7 @@
     <li>step=0.0001 <input type="time" step="0.001"> <input step="0.001" type="time" value="12:34:56.789"></li>
     <li>step=60 <input type="time" step="60"> <input step="60" type="time" value="12:34"></li>
     <li>step=3600 <input type="time" step="3600"> <input step="3600" type="time" value="12:00"></li>
+    <li>step=86400 <input type="time" step="86400"> <input step="86400" type="time" min="12:34:56.789"></li>
     <li>step mismatched   <input type="time" step="60" value="12:34:56"></li>
     <li>RTL <input type="time" step="1" value="12:34:56" dir="rtl"></li>
     <li>Disabled, step=3600 <input disabled type="time" step="3600"> <input disabled step="3600" type="time" value="12:34"></li>

Modified: trunk/LayoutTests/platform/chromium/TestExpectations (136802 => 136803)


--- trunk/LayoutTests/platform/chromium/TestExpectations	2012-12-06 06:09:54 UTC (rev 136802)
+++ trunk/LayoutTests/platform/chromium/TestExpectations	2012-12-06 06:16:37 UTC (rev 136803)
@@ -2819,6 +2819,7 @@
 webkit.org/b/103852 platform/chromium/fast/forms/suggestion-picker/datetime-suggestion-picker-appearance-locale-hebrew.html [ Pass ImageOnlyFailure Missing ]
 webkit.org/b/103852 platform/chromium/fast/forms/suggestion-picker/datetimelocal-suggestion-picker-appearance-locale-hebrew.html [ Pass ImageOnlyFailure Missing ]
 webkit.org/b/103852 platform/chromium/fast/forms/suggestion-picker/time-suggestion-picker-appearance-locale-hebrew.html [ Pass ImageOnlyFailure Missing ]
+webkit.org/b/104210 fast/forms/time/time-appearance-basic.html [ Pass ImageOnlyFailure ]
 
 # New test added in r87324
 crbug.com/83994 [ Win ] platform/win/plugins/call-_javascript_-that-destroys-plugin.html [ Failure ]

Modified: trunk/LayoutTests/platform/chromium-mac/fast/forms/time/time-appearance-basic-expected.png


(Binary files differ)

Modified: trunk/Source/WebCore/ChangeLog (136802 => 136803)


--- trunk/Source/WebCore/ChangeLog	2012-12-06 06:09:54 UTC (rev 136802)
+++ trunk/Source/WebCore/ChangeLog	2012-12-06 06:16:37 UTC (rev 136803)
@@ -1,3 +1,23 @@
+2012-12-05  Kent Tamura  <tk...@chromium.org>
+
+        INPUT_MULTIPLE_FIELDS_UI: The hour, am/pm, millisecond fields should support read-only state correctly
+        https://bugs.webkit.org/show_bug.cgi?id=104210
+
+        Reviewed by Kentaro Hara.
+
+        1. The hour, am/pm, and millisecond fields should have CSS rules for
+           [readonly]. They should be gray when they are read-only.
+        2. The am/pm field should reject to set an empty value like other
+           numeric fields do.
+
+        Tests: Add test cases to fast/forms/time/time-appearance-basic.html.
+
+        * css/html.css: merge existing readonly rules, and add ampm, hour, and
+        millisecond pseudo classes.
+        * html/shadow/DateTimeSymbolicFieldElement.cpp:
+        (WebCore::DateTimeSymbolicFieldElement::setEmptyValue):
+        Reject to set empty value if it is read-only.
+
 2012-12-05  Dan Beam  <db...@chromium.org>
 
         HTMLFormElement#requestAutocomplete() should require a user action

Modified: trunk/Source/WebCore/css/html.css (136802 => 136803)


--- trunk/Source/WebCore/css/html.css	2012-12-06 06:09:54 UTC (rev 136802)
+++ trunk/Source/WebCore/css/html.css	2012-12-06 06:16:37 UTC (rev 136803)
@@ -571,12 +571,10 @@
     outline: none;
 }
 
-/* This selector is used when step >= 3600 second but format contains minute field. */
-input::-webkit-datetime-edit-minute-field[readonly] {
-    color: GrayText;
-}
-
-/* This selector is used when step >= 60 second but format contains second field. */
+input::-webkit-datetime-edit-ampm-field[readonly],
+input::-webkit-datetime-edit-hour-field[readonly],
+input::-webkit-datetime-edit-millisecond-field[readonly],
+input::-webkit-datetime-edit-minute-field[readonly],
 input::-webkit-datetime-edit-second-field[readonly] {
     color: GrayText;
 }

Modified: trunk/Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.cpp (136802 => 136803)


--- trunk/Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.cpp	2012-12-06 06:09:54 UTC (rev 136802)
+++ trunk/Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.cpp	2012-12-06 06:16:37 UTC (rev 136803)
@@ -107,6 +107,8 @@
 
 void DateTimeSymbolicFieldElement::setEmptyValue(EventBehavior eventBehavior)
 {
+    if (isReadOnly())
+        return;
     m_selectedIndex = invalidIndex;
     updateVisibleValue(eventBehavior);
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to