Date input values should not overlap with menu list dropdown button on iOS
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Oct 2015 20:18:56 +0000 (20:18 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Oct 2015 20:18:56 +0000 (20:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=150681
<rdar://problem/19965078>

Reviewed by Zalan Bujtas.

Source/WebCore:

Adds a right margin on iOS date and time inputs so that the inner div does
not render the value of the date on top of the dropdown button on the right
of the menu list.

Tests: fast/forms/date/date-input-rendering-basic.html
       fast/forms/time/time-input-rendering-basic.html

* css/html.css:
(input::-webkit-date-and-time-value):

LayoutTests:

Tests that date and time inputs render properly. Namely, the text should not
be rendered such that it covers the dropdown button on the right of the menu
list.

* fast/forms/date/date-input-rendering-basic-expected.txt: Added.
* fast/forms/date/date-input-rendering-basic.html: Added.
* fast/forms/time/time-input-rendering-basic-expected.txt: Added.
* fast/forms/time/time-input-rendering-basic.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/forms/date/date-input-rendering-basic-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/date/date-input-rendering-basic.html [new file with mode: 0644]
LayoutTests/fast/forms/time/time-input-rendering-basic-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/time/time-input-rendering-basic.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/html.css

index edfa160ac92b3881202116243ffa1fa25f485466..c233610e8920d8779f396b53763248c51b1e8d20 100644 (file)
@@ -1,3 +1,20 @@
+2015-10-29  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Date input values should not overlap with menu list dropdown button on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=150681
+        <rdar://problem/19965078>
+
+        Reviewed by Zalan Bujtas.
+
+        Tests that date and time inputs render properly. Namely, the text should not
+        be rendered such that it covers the dropdown button on the right of the menu
+        list.
+
+        * fast/forms/date/date-input-rendering-basic-expected.txt: Added.
+        * fast/forms/date/date-input-rendering-basic.html: Added.
+        * fast/forms/time/time-input-rendering-basic-expected.txt: Added.
+        * fast/forms/time/time-input-rendering-basic.html: Added.
+
 2015-10-29  Ryan Haddad  <ryanhaddad@apple.com>
 
         storage/indexeddb/modern tests crashing frequently on mac-wk1, marking as flaky crashers
diff --git a/LayoutTests/fast/forms/date/date-input-rendering-basic-expected.txt b/LayoutTests/fast/forms/date/date-input-rendering-basic-expected.txt
new file mode 100644 (file)
index 0000000..2fcef9b
--- /dev/null
@@ -0,0 +1,18 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderText {#text} at (101,2) size 4x19
+        text run at (101,2) width 4: " "
+      RenderText {#text} at (0,0) size 0x0
+layer at (10,10) size 97x22 clip at (11,11) size 95x20
+  RenderFlexibleBox {INPUT} at (2,2) size 97x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)]
+    RenderBlock {DIV} at (6,4) size 57x14
+      RenderText {#text} at (0,0) size 57x14
+        text run at (0,0) width 57: "Apr 1, 1976"
+layer at (115,10) size 97x22 clip at (116,11) size 95x20
+  RenderFlexibleBox {INPUT} at (107,2) size 97x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)]
+    RenderBlock {DIV} at (16,4) size 57x14
+      RenderText {#text} at (0,0) size 57x14
+        text run at (0,0) width 57: "Apr 1, 1976"
diff --git a/LayoutTests/fast/forms/date/date-input-rendering-basic.html b/LayoutTests/fast/forms/date/date-input-rendering-basic.html
new file mode 100644 (file)
index 0000000..abed398
--- /dev/null
@@ -0,0 +1,6 @@
+<html>
+    <body>
+        <input type="date" dir="ltr" value="1976-04-01"></input>
+        <input type="date" dir="rtl" value="1976-04-01"></input>
+    </body>
+</html>
diff --git a/LayoutTests/fast/forms/time/time-input-rendering-basic-expected.txt b/LayoutTests/fast/forms/time/time-input-rendering-basic-expected.txt
new file mode 100644 (file)
index 0000000..da3e12b
--- /dev/null
@@ -0,0 +1,20 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderText {#text} at (82,2) size 4x19
+        text run at (82,2) width 4: " "
+      RenderText {#text} at (0,0) size 0x0
+layer at (10,10) size 78x22 clip at (11,11) size 76x20
+  RenderFlexibleBox {INPUT} at (2,2) size 78x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)]
+    RenderBlock {DIV} at (6,4) size 41x14
+      RenderText {#text} at (0,0) size 41x14
+        text run at (0,0) width 41: "9:41 AM"
+layer at (96,10) size 78x22 clip at (97,11) size 76x20
+  RenderFlexibleBox {INPUT} at (88,2) size 78x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)]
+    RenderBlock {DIV} at (13,4) size 41x14
+      RenderText {#text} at (0,0) size 41x14
+        text run at (0,0) width 17: "AM"
+        text run at (16,0) width 4 RTL: " "
+        text run at (19,0) width 22: "9:41"
diff --git a/LayoutTests/fast/forms/time/time-input-rendering-basic.html b/LayoutTests/fast/forms/time/time-input-rendering-basic.html
new file mode 100644 (file)
index 0000000..7f9cdd8
--- /dev/null
@@ -0,0 +1,6 @@
+<html>
+    <body>
+        <input type="time" dir="ltr" value="09:41:00"></input>
+        <input type="time" dir="rtl" value="09:41:00"></input>
+    </body>
+</html>
index 3ebccff420a6335c5460ee7b91fddd78c917ec0b..ea82c2e8d5eee9a2b3f157651d0f11f789f6c2c9 100644 (file)
@@ -1,3 +1,21 @@
+2015-10-29  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Date input values should not overlap with menu list dropdown button on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=150681
+        <rdar://problem/19965078>
+
+        Reviewed by Zalan Bujtas.
+
+        Adds a right margin on iOS date and time inputs so that the inner div does
+        not render the value of the date on top of the dropdown button on the right
+        of the menu list.
+
+        Tests: fast/forms/date/date-input-rendering-basic.html
+               fast/forms/time/time-input-rendering-basic.html
+
+        * css/html.css:
+        (input::-webkit-date-and-time-value):
+
 2015-10-29  Alex Christensen  <achristensen@webkit.org>
 
         Fix Mac CMake build
index a3ab127a0cf8f7015a5ddbeb6549e00c357b8e89..6659ebec71c02282389abdd1e0354a2db883386d 100644 (file)
@@ -526,12 +526,14 @@ input[type="week"] {
 #endif
 #endif
 
-#if !(defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS)
 input::-webkit-date-and-time-value {
+#if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS
+    margin-right: 18px;
+#else
     margin: 1px 24px 1px 4px;
     white-space: pre;
-}
 #endif
+}
 
 input::-webkit-inner-spin-button {
     -webkit-appearance: inner-spin-button;