Source/WebCore: INPUT_MULTIPLE_FIELDS_UI: The hour, am/pm, millisecond fields should...
authortkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Dec 2012 06:16:37 +0000 (06:16 +0000)
committertkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Dec 2012 06:16:37 +0000 (06:16 +0000)
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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136803 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/forms/time/time-appearance-basic-expected.txt
LayoutTests/fast/forms/time/time-appearance-basic.html
LayoutTests/platform/chromium-mac/fast/forms/time/time-appearance-basic-expected.png
LayoutTests/platform/chromium/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/css/html.css
Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.cpp

index fceeea3..9b2a31b 100644 (file)
@@ -1,3 +1,15 @@
+2012-12-05  Kent Tamura  <tkent@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  <dbeam@chromium.org>
 
         HTMLFormElement#requestAutocomplete() should require a user action
index 3a58407..331034b 100644 (file)
@@ -3,6 +3,7 @@ step=1
 step=0.0001  
 step=60  
 step=3600  
+step=86400  
 step mismatched  
 RTL 
 Disabled, step=3600  
index 54b1698..ae4efcd 100644 (file)
@@ -10,6 +10,7 @@ if (window.testRunner)
     <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>
index d80382e..652d0f4 100644 (file)
Binary files a/LayoutTests/platform/chromium-mac/fast/forms/time/time-appearance-basic-expected.png and b/LayoutTests/platform/chromium-mac/fast/forms/time/time-appearance-basic-expected.png differ
index d917800..8d09226 100644 (file)
@@ -2819,6 +2819,7 @@ webkit.org/b/103852 platform/chromium/fast/forms/suggestion-picker/time-suggesti
 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 ]
index b2c27ae..862e52f 100644 (file)
@@ -1,3 +1,23 @@
+2012-12-05  Kent Tamura  <tkent@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  <dbeam@chromium.org>
 
         HTMLFormElement#requestAutocomplete() should require a user action
index fea7c87..97f627c 100644 (file)
@@ -571,12 +571,10 @@ input::-webkit-datetime-edit-year-field:focus {
     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;
 }
index 62ad52a..14f7ff6 100644 (file)
@@ -107,6 +107,8 @@ int DateTimeSymbolicFieldElement::minimum() const
 
 void DateTimeSymbolicFieldElement::setEmptyValue(EventBehavior eventBehavior)
 {
+    if (isReadOnly())
+        return;
     m_selectedIndex = invalidIndex;
     updateVisibleValue(eventBehavior);
 }