Title: [91345] trunk
Revision
91345
Author
[email protected]
Date
2011-07-20 00:52:39 -0700 (Wed, 20 Jul 2011)

Log Message

input type=number doesn't render correctly in rtl.
https://bugs.webkit.org/show_bug.cgi?id=59703

Source/WebCore:

Reviewed by Ryosuke Niwa.

Test: fast/forms/input-appearance-number-rtl.html

* css/html.css:
(input[type="search"]::-webkit-textfield-decoration-container):
Set "direction: ltr;" only for type=search because we'd like to
respect text direction except type=search.
(input[x-webkit-speech][di=rtl]::-webkit-input-speech-button):
Remove a workaround.
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::layout):
Support for RTL in the spin button location adjustment.

LayoutTests:

Patch by [email protected] <[email protected]@268f45cc-cd09-0410-ab3c-d52691b4dbfc> on 2011-07-20
Reviewed by Ryosuke Niwa.

* fast/forms/input-appearance-number-rtl.html: Added.
* platform/chromium/test_expectations.txt:
* platform/gtk/test_expectations.txt:
* platform/mac/fast/forms/input-appearance-number-rtl-expected.png: Added.
* platform/mac/fast/forms/input-appearance-number-rtl-expected.txt: Added.
* platform/qt/test_expectations.txt:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (91344 => 91345)


--- trunk/LayoutTests/ChangeLog	2011-07-20 07:50:57 UTC (rev 91344)
+++ trunk/LayoutTests/ChangeLog	2011-07-20 07:52:39 UTC (rev 91345)
@@ -1,3 +1,17 @@
+2011-07-20  [email protected]  <[email protected]@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
+
+        input type=number doesn't render correctly in rtl.
+        https://bugs.webkit.org/show_bug.cgi?id=59703
+
+        Reviewed by Ryosuke Niwa.
+
+        * fast/forms/input-appearance-number-rtl.html: Added.
+        * platform/chromium/test_expectations.txt:
+        * platform/gtk/test_expectations.txt:
+        * platform/mac/fast/forms/input-appearance-number-rtl-expected.png: Added.
+        * platform/mac/fast/forms/input-appearance-number-rtl-expected.txt: Added.
+        * platform/qt/test_expectations.txt:
+
 2011-07-19  Gavin Barraclough  <[email protected]>
 
         https://bugs.webkit.org/show_bug.cgi?id=64678

Added: trunk/LayoutTests/fast/forms/input-appearance-number-rtl.html (0 => 91345)


--- trunk/LayoutTests/fast/forms/input-appearance-number-rtl.html	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/input-appearance-number-rtl.html	2011-07-20 07:52:39 UTC (rev 91345)
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<body>
+<!-- A spinbutton should be on the left side. -->
+<p dir=rtl><input type=number value=1>
+<p style="direction:rtl"><input type=number value=2>
+<p><input type=number value=3 dir=rtl>
+<p><input type=number id=i4 style="direction:rtl">
+
+<!-- A spinbutton should be on the right side. -->
+<p><input type=number value=5 id=i5 dir=rtl>
+<p><input type=number value=6 id=i6 style="direction:rtl">
+<!-- A spinbutton should be on the left side. -->
+<p><input type=number value=7 id=i7 dir=ltr>
+<p><input type=number value=8 id=i8 style="direction:ltr">
+
+<script>
+var input = document.getElementById('i4');
+input.focus();
+document.execCommand('insertText', false, '1234');
+
+document.getElementById('i5').dir = 'ltr';
+document.getElementById('i6').style.direction = 'ltr';
+document.getElementById('i7').dir = 'rtl';
+document.getElementById('i8').style.direction = 'rtl';
+</script>
+</body>
+</html>
+
Property changes on: trunk/LayoutTests/fast/forms/input-appearance-number-rtl.html
___________________________________________________________________

Added: svn:eol-style

Modified: trunk/LayoutTests/platform/chromium/test_expectations.txt (91344 => 91345)


--- trunk/LayoutTests/platform/chromium/test_expectations.txt	2011-07-20 07:50:57 UTC (rev 91344)
+++ trunk/LayoutTests/platform/chromium/test_expectations.txt	2011-07-20 07:52:39 UTC (rev 91345)
@@ -3743,6 +3743,9 @@
 // Quota enforcement not yet implemented for LevelDB back-end.
 BUGCR83652 : storage/indexeddb/database-quota.html = TEXT
 
+// New test. Need platform-dependent baseline files.
+BUGWK59703 : fast/forms/input-appearance-number-rtl.html = FAIL
+
 BUGCR88311 MAC DEBUG : fast/css/last-of-type-pseudo-class.html = TEXT
 
 BUGWK63902 MAC WIN : svg/animations/svgtransform-animation-1.html = TEXT PASS

Modified: trunk/LayoutTests/platform/gtk/test_expectations.txt (91344 => 91345)


--- trunk/LayoutTests/platform/gtk/test_expectations.txt	2011-07-20 07:50:57 UTC (rev 91344)
+++ trunk/LayoutTests/platform/gtk/test_expectations.txt	2011-07-20 07:52:39 UTC (rev 91345)
@@ -17,3 +17,6 @@
 BUGWK64253 : fast/forms/textarea-placeholder-pseudo-style.html = FAIL
 BUGWK64253 : fast/forms/textarea-placeholder-set-attribute.html = FAIL
 BUGWK64253 : fast/forms/textarea-placeholder-wrapping.html = FAIL
+
+// New test. Need platform-dependent baseline files.
+BUGWK59703 : fast/forms/input-appearance-number-rtl.html = FAIL

Added: trunk/LayoutTests/platform/mac/fast/forms/input-appearance-number-rtl-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/fast/forms/input-appearance-number-rtl-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/mac/fast/forms/input-appearance-number-rtl-expected.txt (0 => 91345)


--- trunk/LayoutTests/platform/mac/fast/forms/input-appearance-number-rtl-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/forms/input-appearance-number-rtl-expected.txt	2011-07-20 07:52:39 UTC (rev 91345)
@@ -0,0 +1,97 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x328
+  RenderBlock {HTML} at (0,0) size 800x328
+    RenderBody {BODY} at (8,16) size 784x296
+      RenderBlock {P} at (0,0) size 784x23
+        RenderTextControl {INPUT} at (657,2) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+          RenderDeprecatedFlexibleBox {DIV} at (3,3) size 119x13
+            RenderBlock {DIV} at (13,0) size 106x13
+        RenderText {#text} at (0,0) size 0x0
+      RenderBlock {P} at (0,39) size 784x23
+        RenderTextControl {INPUT} at (657,2) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+          RenderDeprecatedFlexibleBox {DIV} at (3,3) size 119x13
+            RenderBlock {DIV} at (13,0) size 106x13
+        RenderText {#text} at (0,0) size 0x0
+      RenderBlock {P} at (0,78) size 784x23
+        RenderTextControl {INPUT} at (2,2) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+          RenderDeprecatedFlexibleBox {DIV} at (3,3) size 119x13
+            RenderBlock {DIV} at (13,0) size 106x13
+        RenderText {#text} at (0,0) size 0x0
+      RenderBlock {P} at (0,117) size 784x23
+        RenderTextControl {INPUT} at (2,2) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+          RenderDeprecatedFlexibleBox {DIV} at (3,3) size 119x13
+            RenderBlock {DIV} at (13,0) size 106x13
+        RenderText {#text} at (0,0) size 0x0
+        RenderText {#text} at (0,0) size 0x0
+      RenderBlock {P} at (0,156) size 784x23
+        RenderTextControl {INPUT} at (2,2) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+          RenderDeprecatedFlexibleBox {DIV} at (3,3) size 119x13
+            RenderBlock {DIV} at (0,0) size 106x13
+        RenderText {#text} at (0,0) size 0x0
+      RenderBlock {P} at (0,195) size 784x23
+        RenderTextControl {INPUT} at (2,2) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+          RenderDeprecatedFlexibleBox {DIV} at (3,3) size 119x13
+            RenderBlock {DIV} at (0,0) size 106x13
+        RenderText {#text} at (0,0) size 0x0
+        RenderText {#text} at (0,0) size 0x0
+      RenderBlock {P} at (0,234) size 784x23
+        RenderTextControl {INPUT} at (2,2) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+          RenderDeprecatedFlexibleBox {DIV} at (3,3) size 119x13
+            RenderBlock {DIV} at (13,0) size 106x13
+        RenderText {#text} at (0,0) size 0x0
+      RenderBlock {P} at (0,273) size 784x23
+        RenderTextControl {INPUT} at (2,2) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+          RenderDeprecatedFlexibleBox {DIV} at (3,3) size 119x13
+            RenderBlock {DIV} at (13,0) size 106x13
+        RenderText {#text} at (0,0) size 0x0
+        RenderText {#text} at (0,0) size 0x0
+layer at (681,21) size 106x13
+  RenderBlock {DIV} at (0,0) size 106x13
+    RenderText {#text} at (98,0) size 7x13
+      text run at (98,0) width 7: "1"
+layer at (681,60) size 106x13
+  RenderBlock {DIV} at (0,0) size 106x13
+    RenderText {#text} at (98,0) size 7x13
+      text run at (98,0) width 7: "2"
+layer at (26,99) size 106x13
+  RenderBlock {DIV} at (0,0) size 106x13
+    RenderText {#text} at (98,0) size 7x13
+      text run at (98,0) width 7: "3"
+layer at (26,138) size 106x13
+  RenderBlock {DIV} at (0,0) size 106x13
+    RenderText {#text} at (77,0) size 28x13
+      text run at (77,0) width 28: "1234"
+layer at (13,177) size 106x13
+  RenderBlock {DIV} at (0,0) size 106x13
+    RenderText {#text} at (1,0) size 7x13
+      text run at (1,0) width 7: "5"
+layer at (13,216) size 106x13
+  RenderBlock {DIV} at (0,0) size 106x13
+    RenderText {#text} at (1,0) size 7x13
+      text run at (1,0) width 7: "6"
+layer at (26,255) size 106x13
+  RenderBlock {DIV} at (0,0) size 106x13
+    RenderText {#text} at (98,0) size 7x13
+      text run at (98,0) width 7: "7"
+layer at (26,294) size 106x13
+  RenderBlock {DIV} at (0,0) size 106x13
+    RenderText {#text} at (98,0) size 7x13
+      text run at (98,0) width 7: "8"
+layer at (667,20) size 13x15
+  RenderBlock (relative positioned) {DIV} at (-1,-1) size 13x15
+layer at (667,59) size 13x15
+  RenderBlock (relative positioned) {DIV} at (-1,-1) size 13x15
+layer at (12,98) size 13x15
+  RenderBlock (relative positioned) {DIV} at (-1,-1) size 13x15
+layer at (12,137) size 13x15
+  RenderBlock (relative positioned) {DIV} at (-1,-1) size 13x15
+layer at (120,176) size 13x15
+  RenderBlock (relative positioned) {DIV} at (107,-1) size 13x15
+layer at (120,215) size 13x15
+  RenderBlock (relative positioned) {DIV} at (107,-1) size 13x15
+layer at (12,254) size 13x15
+  RenderBlock (relative positioned) {DIV} at (-1,-1) size 13x15
+layer at (12,293) size 13x15
+  RenderBlock (relative positioned) {DIV} at (-1,-1) size 13x15
+caret: position 4 of child 0 {#text} of child 0 {DIV} of child 0 {DIV} of child 0 {DIV} of {#shadow-root} of child 0 {INPUT} of child 6 {P} of body
Property changes on: trunk/LayoutTests/platform/mac/fast/forms/input-appearance-number-rtl-expected.txt
___________________________________________________________________

Added: svn:eol-style

Modified: trunk/LayoutTests/platform/qt/test_expectations.txt (91344 => 91345)


--- trunk/LayoutTests/platform/qt/test_expectations.txt	2011-07-20 07:50:57 UTC (rev 91344)
+++ trunk/LayoutTests/platform/qt/test_expectations.txt	2011-07-20 07:52:39 UTC (rev 91345)
@@ -2,6 +2,9 @@
 //
 // See http://trac.webkit.org/wiki/TestExpectations for more information on this file.
 
+// New test. Need platform-dependent baseline files.
+BUGWK59703 : fast/forms/input-appearance-number-rtl.html = FAIL
+
 BUGWK64002 : http/tests/misc/object-embedding-svg-delayed-size-negotiation-2.htm = TEXT PASS
 
 SKIP BUGWK64002 : fast/forms/textfield-overflow-by-value-update.html = PASS FAIL

Modified: trunk/Source/WebCore/ChangeLog (91344 => 91345)


--- trunk/Source/WebCore/ChangeLog	2011-07-20 07:50:57 UTC (rev 91344)
+++ trunk/Source/WebCore/ChangeLog	2011-07-20 07:52:39 UTC (rev 91345)
@@ -1,3 +1,22 @@
+2011-07-20  Kent Tamura  <[email protected]>
+
+        input type=number doesn't render correctly in rtl.
+        https://bugs.webkit.org/show_bug.cgi?id=59703
+
+        Reviewed by Ryosuke Niwa.
+
+        Test: fast/forms/input-appearance-number-rtl.html
+
+        * css/html.css:
+        (input[type="search"]::-webkit-textfield-decoration-container):
+        Set "direction: ltr;" only for type=search because we'd like to
+        respect text direction except type=search.
+        (input[x-webkit-speech][di=rtl]::-webkit-input-speech-button):
+        Remove a workaround.
+        * rendering/RenderTextControlSingleLine.cpp:
+        (WebCore::RenderTextControlSingleLine::layout):
+        Support for RTL in the spin button location adjustment.
+
 2011-07-19  Steve Lacey  <[email protected]>
 
         [chromium] Media player controls do not fade out.

Modified: trunk/Source/WebCore/css/html.css (91344 => 91345)


--- trunk/Source/WebCore/css/html.css	2011-07-20 07:50:57 UTC (rev 91344)
+++ trunk/Source/WebCore/css/html.css	2011-07-20 07:52:39 UTC (rev 91345)
@@ -420,11 +420,14 @@
 }
 
 input::-webkit-textfield-decoration-container {
-    direction: ltr;
     display: -webkit-box;
     -webkit-box-align: center;
 }
 
+input[type="search"]::-webkit-textfield-decoration-container {
+    direction: ltr;
+}
+
 input[type="search"]::-webkit-search-cancel-button {
     -webkit-appearance: searchfield-cancel-button;
     display: block;
@@ -473,10 +476,6 @@
     vertical-align: top;
     -webkit-box-flex: 0;
 }
-
-input[x-webkit-speech][dir=rtl]::-webkit-textfield-decoration-container {
-    direction: rtl;
-}
 #endif
 
 keygen, select {

Modified: trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp (91344 => 91345)


--- trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp	2011-07-20 07:50:57 UTC (rev 91344)
+++ trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp	2011-07-20 07:52:39 UTC (rev 91345)
@@ -276,7 +276,10 @@
     // Ignores the paddings for the inner spin button.
     if (RenderBox* innerSpinBox = innerSpinButtonElement() ? innerSpinButtonElement()->renderBox() : 0) {
         RenderBox* parentBox = innerSpinBox->parentBox();
-        innerSpinBox->setLocation(LayoutPoint(parentBox->width() - innerSpinBox->width() + paddingRight(), -paddingTop()));
+        if (containerRenderer && !containerRenderer->style()->isLeftToRightDirection())
+            innerSpinBox->setLocation(LayoutPoint(-paddingLeft(), -paddingTop()));
+        else
+            innerSpinBox->setLocation(LayoutPoint(parentBox->width() - innerSpinBox->width() + paddingRight(), -paddingTop()));
         innerSpinBox->setHeight(height() - borderTop() - borderBottom());
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to