Title: [201397] trunk
Revision
201397
Author
[email protected]
Date
2016-05-25 12:41:34 -0700 (Wed, 25 May 2016)

Log Message

Swap search field's cancel and result button for RTL content.
https://bugs.webkit.org/show_bug.cgi?id=158007

Reviewed by Dean Jackson.

Source/WebCore:

Test: fast/forms/search-input-rtl.html

* css/html.css:
(input[type="search"]::-webkit-textfield-decoration-container): Deleted.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintSearchFieldCancelButton):
(WebCore::RenderThemeMac::paintSearchFieldResultsButton):

LayoutTests:

* fast/forms/resources/common.js:
(searchCancelButtonPositionRTL):
(searchCancelButtonPosition):
* fast/forms/search-input-rtl.html: Added.
* fast/forms/search-rtl.html:
* platform/ios-simulator-wk2/fast/forms/search-rtl-expected.txt:
* platform/ios-simulator/fast/css/text-overflow-input-expected.txt:
* platform/ios-simulator/fast/forms/search-input-rtl-expected.txt: Added.
* platform/mac/fast/css/text-overflow-input-expected.txt:
* platform/mac/fast/forms/placeholder-position-expected.txt:
* platform/mac/fast/forms/search-input-rtl-expected.png: Added.
* platform/mac/fast/forms/search-input-rtl-expected.txt: Added.
* platform/mac/fast/forms/search-rtl-expected.txt:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (201396 => 201397)


--- trunk/LayoutTests/ChangeLog	2016-05-25 19:39:46 UTC (rev 201396)
+++ trunk/LayoutTests/ChangeLog	2016-05-25 19:41:34 UTC (rev 201397)
@@ -1,3 +1,24 @@
+2016-05-25  Zalan Bujtas  <[email protected]>
+
+        Swap search field's cancel and result button for RTL content.
+        https://bugs.webkit.org/show_bug.cgi?id=158007
+
+        Reviewed by Dean Jackson.
+
+        * fast/forms/resources/common.js:
+        (searchCancelButtonPositionRTL):
+        (searchCancelButtonPosition):
+        * fast/forms/search-input-rtl.html: Added.
+        * fast/forms/search-rtl.html:
+        * platform/ios-simulator-wk2/fast/forms/search-rtl-expected.txt:
+        * platform/ios-simulator/fast/css/text-overflow-input-expected.txt:
+        * platform/ios-simulator/fast/forms/search-input-rtl-expected.txt: Added.
+        * platform/mac/fast/css/text-overflow-input-expected.txt:
+        * platform/mac/fast/forms/placeholder-position-expected.txt:
+        * platform/mac/fast/forms/search-input-rtl-expected.png: Added.
+        * platform/mac/fast/forms/search-input-rtl-expected.txt: Added.
+        * platform/mac/fast/forms/search-rtl-expected.txt:
+
 2016-05-25  Myles C. Maxfield  <[email protected]>
 
         [Font Loading] ASSERT if calling FontFace.loaded twice with a garbage collection between them

Modified: trunk/LayoutTests/fast/forms/resources/common.js (201396 => 201397)


--- trunk/LayoutTests/fast/forms/resources/common.js	2016-05-25 19:39:46 UTC (rev 201396)
+++ trunk/LayoutTests/fast/forms/resources/common.js	2016-05-25 19:41:34 UTC (rev 201397)
@@ -100,9 +100,13 @@
     return rect;
 }
 
-function searchCancelButtonPosition(element) {
+function searchCancelButtonPositionRTL(element) {
+	return searchCancelButtonPosition(element, true);
+}
+
+function searchCancelButtonPosition(element, isRTL = false) {
     var pos = {};
-    pos.x = element.offsetLeft + element.offsetWidth - 9;
+    pos.x = element.offsetLeft + (isRTL ? 9 : (element.offsetWidth - 9));
     pos.y = element.offsetTop + element.offsetHeight / 2;
     return pos;
 }

Added: trunk/LayoutTests/fast/forms/search-input-rtl.html (0 => 201397)


--- trunk/LayoutTests/fast/forms/search-input-rtl.html	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/search-input-rtl.html	2016-05-25 19:41:34 UTC (rev 201397)
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that we position cancel/magnifier buttons properly for RTL content.</title>
+</head>
+<body>
+<div dir=rtl>
+right to left search fields:
+<input type="search" value="foobar" >
+<input type="search" results=5 value="foobar" >
+</div>
+<div>
+left to right search fields:
+<input type="search" value="foobar" >
+<input type="search" results=5 value="foobar" >
+</div>
+</body>

Modified: trunk/LayoutTests/fast/forms/search-rtl.html (201396 => 201397)


--- trunk/LayoutTests/fast/forms/search-rtl.html	2016-05-25 19:39:46 UTC (rev 201396)
+++ trunk/LayoutTests/fast/forms/search-rtl.html	2016-05-25 19:41:34 UTC (rev 201397)
@@ -22,7 +22,7 @@
     <script>
         if (window.eventSender) {
             var target = $("target");
-            var pos = searchCancelButtonPosition(target);
+            var pos = searchCancelButtonPositionRTL(target);
             eventSender.mouseMoveTo(pos.x, pos.y);
             eventSender.mouseDown();
             eventSender.mouseUp();

Modified: trunk/LayoutTests/platform/ios-simulator/fast/css/text-overflow-input-expected.txt (201396 => 201397)


--- trunk/LayoutTests/platform/ios-simulator/fast/css/text-overflow-input-expected.txt	2016-05-25 19:39:46 UTC (rev 201396)
+++ trunk/LayoutTests/platform/ios-simulator/fast/css/text-overflow-input-expected.txt	2016-05-25 19:41:34 UTC (rev 201397)
@@ -37,9 +37,9 @@
           text run at (139,46) width 5: " "
         RenderTextControl {INPUT} at (145,47) size 136x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)]
           RenderFlexibleBox {DIV} at (6,3) size 123x15
+            RenderBlock {DIV} at (122,7) size 0x0
+            RenderBlock {DIV} at (0,0) size 123x14
             RenderBlock {DIV} at (0,7) size 0x0
-            RenderBlock {DIV} at (0,0) size 123x14
-            RenderBlock {DIV} at (122,7) size 0x0
         RenderText {#text} at (282,46) size 5x19
           text run at (282,46) width 5: " "
         RenderTextControl {INPUT} at (288,47) size 137x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)]
@@ -47,9 +47,9 @@
           text run at (426,46) width 5: " "
         RenderTextControl {INPUT} at (432,47) size 136x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)]
           RenderFlexibleBox {DIV} at (6,3) size 123x15
+            RenderBlock {DIV} at (122,7) size 0x0
+            RenderBlock {DIV} at (0,0) size 123x14
             RenderBlock {DIV} at (0,7) size 0x0
-            RenderBlock {DIV} at (0,0) size 123x14
-            RenderBlock {DIV} at (122,7) size 0x0
         RenderText {#text} at (569,46) size 5x19
           text run at (569,46) width 5: " "
         RenderTextControl {INPUT} at (575,47) size 136x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)]
@@ -85,9 +85,9 @@
           text run at (139,46) width 5: " "
         RenderTextControl {INPUT} at (145,47) size 136x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)]
           RenderFlexibleBox {DIV} at (6,3) size 123x15
+            RenderBlock {DIV} at (122,7) size 0x0
+            RenderBlock {DIV} at (0,0) size 123x14
             RenderBlock {DIV} at (0,7) size 0x0
-            RenderBlock {DIV} at (0,0) size 123x14
-            RenderBlock {DIV} at (122,7) size 0x0
         RenderText {#text} at (282,46) size 5x19
           text run at (282,46) width 5: " "
         RenderTextControl {INPUT} at (288,47) size 137x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)]
@@ -95,9 +95,9 @@
           text run at (426,46) width 5: " "
         RenderTextControl {INPUT} at (432,47) size 136x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)]
           RenderFlexibleBox {DIV} at (6,3) size 123x15
+            RenderBlock {DIV} at (122,7) size 0x0
+            RenderBlock {DIV} at (0,0) size 123x14
             RenderBlock {DIV} at (0,7) size 0x0
-            RenderBlock {DIV} at (0,0) size 123x14
-            RenderBlock {DIV} at (122,7) size 0x0
         RenderText {#text} at (569,46) size 5x19
           text run at (569,46) width 5: " "
         RenderTextControl {INPUT} at (575,47) size 136x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)]

Added: trunk/LayoutTests/platform/ios-simulator/fast/forms/search-input-rtl-expected.txt (0 => 201397)


--- trunk/LayoutTests/platform/ios-simulator/fast/forms/search-input-rtl-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios-simulator/fast/forms/search-input-rtl-expected.txt	2016-05-25 19:41:34 UTC (rev 201397)
@@ -0,0 +1,54 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x66
+  RenderBlock {HTML} at (0,0) size 800x66
+    RenderBody {BODY} at (8,8) size 784x50
+      RenderBlock {DIV} at (0,0) size 784x25
+        RenderText {#text} at (619,1) size 165x19
+          text run at (619,1) width 9 RTL: ": "
+          text run at (627,1) width 157: "right to left search fields"
+        RenderTextControl {INPUT} at (481,2) size 137x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)]
+          RenderFlexibleBox {DIV} at (6,3) size 123x15
+            RenderBlock {DIV} at (122,7) size 0x0
+            RenderBlock {DIV} at (0,0) size 123x14
+            RenderBlock {DIV} at (0,7) size 0x0
+        RenderText {#text} at (475,1) size 5x19
+          text run at (475,1) width 5 RTL: " "
+        RenderTextControl {INPUT} at (338,2) size 136x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)]
+          RenderFlexibleBox {DIV} at (6,3) size 123x15
+            RenderBlock {DIV} at (122,7) size 0x0
+            RenderBlock {DIV} at (0,0) size 123x14
+            RenderBlock {DIV} at (0,7) size 0x0
+        RenderText {#text} at (0,0) size 0x0
+      RenderBlock {DIV} at (0,25) size 784x25
+        RenderText {#text} at (0,1) size 165x19
+          text run at (0,1) width 165: "left to right search fields: "
+        RenderTextControl {INPUT} at (166,2) size 137x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)]
+          RenderFlexibleBox {DIV} at (6,3) size 123x15
+            RenderBlock {DIV} at (0,7) size 0x0
+            RenderBlock {DIV} at (0,0) size 123x14
+            RenderBlock {DIV} at (122,7) size 0x0
+        RenderText {#text} at (304,1) size 5x19
+          text run at (304,1) width 5: " "
+        RenderTextControl {INPUT} at (310,2) size 136x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)]
+          RenderFlexibleBox {DIV} at (6,3) size 123x15
+            RenderBlock {DIV} at (0,7) size 0x0
+            RenderBlock {DIV} at (0,0) size 123x14
+            RenderBlock {DIV} at (122,7) size 0x0
+        RenderText {#text} at (0,0) size 0x0
+layer at (496,13) size 122x14
+  RenderBlock {DIV} at (0,0) size 123x14
+    RenderText {#text} at (91,0) size 32x14
+      text run at (91,0) width 32: "foobar"
+layer at (353,13) size 122x14
+  RenderBlock {DIV} at (0,0) size 123x14
+    RenderText {#text} at (91,0) size 32x14
+      text run at (91,0) width 32: "foobar"
+layer at (181,38) size 122x14
+  RenderBlock {DIV} at (0,0) size 123x14
+    RenderText {#text} at (0,0) size 32x14
+      text run at (0,0) width 32: "foobar"
+layer at (325,38) size 122x14
+  RenderBlock {DIV} at (0,0) size 123x14
+    RenderText {#text} at (0,0) size 32x14
+      text run at (0,0) width 32: "foobar"

Modified: trunk/LayoutTests/platform/ios-simulator-wk2/fast/forms/search-rtl-expected.txt (201396 => 201397)


--- trunk/LayoutTests/platform/ios-simulator-wk2/fast/forms/search-rtl-expected.txt	2016-05-25 19:39:46 UTC (rev 201396)
+++ trunk/LayoutTests/platform/ios-simulator-wk2/fast/forms/search-rtl-expected.txt	2016-05-25 19:41:34 UTC (rev 201397)
@@ -18,25 +18,25 @@
       RenderBlock {P} at (0,36) size 784x75
         RenderTextControl {INPUT} at (2,2) size 136x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)]
           RenderFlexibleBox {DIV} at (6,2) size 123x16
+            RenderBlock {DIV} at (122,7) size 0x0
+            RenderBlock {DIV} at (0,0) size 123x15
             RenderBlock {DIV} at (0,7) size 0x0
-            RenderBlock {DIV} at (0,0) size 123x15
-            RenderBlock {DIV} at (122,7) size 0x0
         RenderText {#text} at (139,0) size 5x19
           text run at (139,0) width 5: " "
         RenderBR {BR} at (0,0) size 0x0
         RenderTextControl {INPUT} at (2,27) size 197x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)]
           RenderFlexibleBox {DIV} at (6,2) size 185x16
+            RenderBlock {DIV} at (183,7) size 0x0
+            RenderBlock {DIV} at (0,0) size 184x15
             RenderBlock {DIV} at (0,7) size 0x0
-            RenderBlock {DIV} at (0,0) size 184x15
-            RenderBlock {DIV} at (183,7) size 0x0
         RenderText {#text} at (200,25) size 5x19
           text run at (200,25) width 5: " "
         RenderBR {BR} at (0,0) size 0x0
         RenderTextControl {INPUT} at (2,52) size 136x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)]
           RenderFlexibleBox {DIV} at (6,3) size 123x15
+            RenderBlock {DIV} at (122,7) size 0x0
+            RenderBlock {DIV} at (0,0) size 123x14
             RenderBlock {DIV} at (0,7) size 0x0
-            RenderBlock {DIV} at (0,0) size 123x14
-            RenderBlock {DIV} at (122,7) size 0x0
         RenderText {#text} at (0,0) size 0x0
       RenderBlock {P} at (0,127) size 784x20
         RenderText {#text} at (0,0) size 35x19

Modified: trunk/LayoutTests/platform/mac/fast/css/text-overflow-input-expected.txt (201396 => 201397)


--- trunk/LayoutTests/platform/mac/fast/css/text-overflow-input-expected.txt	2016-05-25 19:39:46 UTC (rev 201396)
+++ trunk/LayoutTests/platform/mac/fast/css/text-overflow-input-expected.txt	2016-05-25 19:41:34 UTC (rev 201397)
@@ -39,9 +39,9 @@
           text run at (140,43) width 5: " "
         RenderTextControl {INPUT} at (146,43) size 164x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
           RenderFlexibleBox {DIV} at (3,0) size 158x19
-            RenderBlock {DIV} at (0,0) size 8x19
-            RenderBlock {DIV} at (8,3) size 131x13
-            RenderBlock {DIV} at (138,0) size 20x19
+            RenderBlock {DIV} at (149,0) size 9x19
+            RenderBlock {DIV} at (19,3) size 131x13
+            RenderBlock {DIV} at (0,0) size 19x19
         RenderText {#text} at (311,43) size 5x18
           text run at (311,43) width 5: " "
         RenderTextControl {INPUT} at (317,43) size 138x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
@@ -49,9 +49,9 @@
           text run at (456,43) width 5: " "
         RenderTextControl {INPUT} at (462,43) size 164x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
           RenderFlexibleBox {DIV} at (3,0) size 158x19
-            RenderBlock {DIV} at (0,0) size 8x19
-            RenderBlock {DIV} at (8,3) size 131x13
-            RenderBlock {DIV} at (138,0) size 20x19
+            RenderBlock {DIV} at (149,0) size 9x19
+            RenderBlock {DIV} at (19,3) size 131x13
+            RenderBlock {DIV} at (0,0) size 19x19
         RenderText {#text} at (627,43) size 5x18
           text run at (627,43) width 5: " "
         RenderTextControl {INPUT} at (633,43) size 137x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
@@ -91,9 +91,9 @@
           text run at (140,43) width 5: " "
         RenderTextControl {INPUT} at (146,43) size 164x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
           RenderFlexibleBox {DIV} at (3,0) size 158x19
-            RenderBlock {DIV} at (0,0) size 8x19
-            RenderBlock {DIV} at (8,3) size 131x13
-            RenderBlock {DIV} at (138,0) size 20x19
+            RenderBlock {DIV} at (149,0) size 9x19
+            RenderBlock {DIV} at (19,3) size 131x13
+            RenderBlock {DIV} at (0,0) size 19x19
         RenderText {#text} at (311,43) size 5x18
           text run at (311,43) width 5: " "
         RenderTextControl {INPUT} at (317,43) size 138x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
@@ -101,9 +101,9 @@
           text run at (456,43) width 5: " "
         RenderTextControl {INPUT} at (462,43) size 164x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
           RenderFlexibleBox {DIV} at (3,0) size 158x19
-            RenderBlock {DIV} at (0,0) size 8x19
-            RenderBlock {DIV} at (8,3) size 131x13
-            RenderBlock {DIV} at (138,0) size 20x19
+            RenderBlock {DIV} at (149,0) size 9x19
+            RenderBlock {DIV} at (19,3) size 131x13
+            RenderBlock {DIV} at (0,0) size 19x19
         RenderText {#text} at (627,43) size 5x18
           text run at (627,43) width 5: " "
         RenderTextControl {INPUT} at (633,43) size 137x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
@@ -162,17 +162,17 @@
       text run at (-160,0) width 291: "Lorem ipsum dolor sit amet, consectetur adipiscing elit"
 layer at (13,96) size 130x13
   RenderBlock {DIV} at (3,3) size 131x13
-layer at (165,96) size 130x13 scrollX 160 scrollWidth 291
-  RenderBlock {DIV} at (11,3) size 131x13 [color=#A9A9A9]
+layer at (176,96) size 130x13 scrollX 160 scrollWidth 291
+  RenderBlock {DIV} at (22,3) size 131x13 [color=#A9A9A9]
     RenderText {#text} at (-160,0) size 292x13
       text run at (-160,0) width 291: "Lorem ipsum dolor sit amet, consectetur adipiscing elit"
-layer at (165,96) size 130x13
+layer at (176,96) size 130x13
   RenderBlock {DIV} at (0,0) size 131x13
 layer at (329,96) size 130x13 scrollX 160 scrollWidth 291
   RenderBlock {DIV} at (3,3) size 131x13
     RenderText {#text} at (-160,0) size 292x13
       text run at (-160,0) width 291: "Lorem ipsum dolor sit amet, consectetur adipiscing elit"
-layer at (481,96) size 130x13 scrollX 160 scrollWidth 291
+layer at (492,96) size 130x13 scrollX 160 scrollWidth 291
   RenderBlock {DIV} at (0,0) size 131x13
     RenderText {#text} at (-160,0) size 292x13
       text run at (-160,0) width 291: "Lorem ipsum dolor sit amet, consectetur adipiscing elit"
@@ -210,17 +210,17 @@
       text run at (-160,0) width 291: "Lorem ipsum dolor sit amet, consectetur adipiscing elit"
 layer at (13,176) size 130x13
   RenderBlock {DIV} at (3,3) size 131x13
-layer at (165,176) size 130x13 scrollX 160 scrollWidth 291
-  RenderBlock {DIV} at (11,3) size 131x13 [color=#A9A9A9]
+layer at (176,176) size 130x13 scrollX 160 scrollWidth 291
+  RenderBlock {DIV} at (22,3) size 131x13 [color=#A9A9A9]
     RenderText {#text} at (-160,0) size 292x13
       text run at (-160,0) width 291: "Lorem ipsum dolor sit amet, consectetur adipiscing elit"
-layer at (165,176) size 130x13
+layer at (176,176) size 130x13
   RenderBlock {DIV} at (0,0) size 131x13
 layer at (329,176) size 130x13 scrollX 160 scrollWidth 291
   RenderBlock {DIV} at (3,3) size 131x13
     RenderText {#text} at (-160,0) size 292x13
       text run at (-160,0) width 291: "Lorem ipsum dolor sit amet, consectetur adipiscing elit"
-layer at (481,176) size 130x13 scrollX 160 scrollWidth 291
+layer at (492,176) size 130x13 scrollX 160 scrollWidth 291
   RenderBlock {DIV} at (0,0) size 131x13
     RenderText {#text} at (-160,0) size 292x13
       text run at (-160,0) width 291: "Lorem ipsum dolor sit amet, consectetur adipiscing elit"

Modified: trunk/LayoutTests/platform/mac/fast/forms/placeholder-position-expected.txt (201396 => 201397)


--- trunk/LayoutTests/platform/mac/fast/forms/placeholder-position-expected.txt	2016-05-25 19:39:46 UTC (rev 201396)
+++ trunk/LayoutTests/platform/mac/fast/forms/placeholder-position-expected.txt	2016-05-25 19:41:34 UTC (rev 201397)
@@ -13,9 +13,9 @@
       RenderBR {BR} at (140,39) size 1x0
       RenderTextControl {INPUT} at (2,48) size 164x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
         RenderFlexibleBox {DIV} at (3,0) size 158x19
-          RenderBlock {DIV} at (0,0) size 8x19
-          RenderBlock {DIV} at (8,3) size 131x13
-          RenderBlock {DIV} at (138,0) size 20x19
+          RenderBlock {DIV} at (149,0) size 9x19
+          RenderBlock {DIV} at (19,3) size 131x13
+          RenderBlock {DIV} at (0,0) size 19x19
       RenderBR {BR} at (167,62) size 1x0
       RenderTextControl {INPUT} at (2,71) size 178x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
         RenderFlexibleBox {DIV} at (3,0) size 172x19
@@ -59,11 +59,11 @@
       text run at (0,0) width 62: "placeholder"
 layer at (13,36) size 130x13
   RenderBlock {DIV} at (3,3) size 131x13
-layer at (21,59) size 130x13
-  RenderBlock {DIV} at (11,3) size 131x13 [color=#A9A9A9]
+layer at (32,59) size 130x13
+  RenderBlock {DIV} at (22,3) size 131x13 [color=#A9A9A9]
     RenderText {#text} at (68,0) size 63x13
       text run at (68,0) width 63: "placeholder"
-layer at (21,59) size 130x13
+layer at (32,59) size 130x13
   RenderBlock {DIV} at (0,0) size 131x13
 layer at (35,82) size 130x13
   RenderBlock {DIV} at (25,3) size 131x13 [color=#A9A9A9]

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


--- trunk/LayoutTests/platform/mac/fast/forms/search-input-rtl-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/forms/search-input-rtl-expected.txt	2016-05-25 19:41:34 UTC (rev 201397)
@@ -0,0 +1,54 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x62
+  RenderBlock {HTML} at (0,0) size 800x62
+    RenderBody {BODY} at (8,8) size 784x46
+      RenderBlock {DIV} at (0,0) size 784x23
+        RenderText {#text} at (620,2) size 164x18
+          text run at (620,2) width 9 RTL: ": "
+          text run at (628,2) width 156: "right to left search fields"
+        RenderTextControl {INPUT} at (454,2) size 165x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+          RenderFlexibleBox {DIV} at (3,0) size 158x19
+            RenderBlock {DIV} at (149,0) size 9x19
+            RenderBlock {DIV} at (19,3) size 131x13
+            RenderBlock {DIV} at (0,0) size 19x19
+        RenderText {#text} at (448,2) size 5x18
+          text run at (448,2) width 5 RTL: " "
+        RenderTextControl {INPUT} at (269,2) size 178x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+          RenderFlexibleBox {DIV} at (3,0) size 172x19
+            RenderBlock {DIV} at (149,0) size 23x19
+            RenderBlock {DIV} at (19,3) size 131x13
+            RenderBlock {DIV} at (0,0) size 19x19
+        RenderText {#text} at (0,0) size 0x0
+      RenderBlock {DIV} at (0,23) size 784x23
+        RenderText {#text} at (0,2) size 164x18
+          text run at (0,2) width 164: "left to right search fields: "
+        RenderTextControl {INPUT} at (165,2) size 165x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+          RenderFlexibleBox {DIV} at (3,0) size 158x19
+            RenderBlock {DIV} at (0,0) size 8x19
+            RenderBlock {DIV} at (8,3) size 131x13
+            RenderBlock {DIV} at (138,0) size 20x19
+        RenderText {#text} at (331,2) size 5x18
+          text run at (331,2) width 5: " "
+        RenderTextControl {INPUT} at (337,2) size 178x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+          RenderFlexibleBox {DIV} at (3,0) size 172x19
+            RenderBlock {DIV} at (0,0) size 22x19
+            RenderBlock {DIV} at (22,3) size 131x13
+            RenderBlock {DIV} at (152,0) size 20x19
+        RenderText {#text} at (0,0) size 0x0
+layer at (485,13) size 130x13
+  RenderBlock {DIV} at (0,0) size 131x13
+    RenderText {#text} at (96,0) size 35x13
+      text run at (96,0) width 35: "foobar"
+layer at (299,13) size 130x13
+  RenderBlock {DIV} at (0,0) size 131x13
+    RenderText {#text} at (96,0) size 35x13
+      text run at (96,0) width 35: "foobar"
+layer at (185,36) size 130x13
+  RenderBlock {DIV} at (0,0) size 131x13
+    RenderText {#text} at (0,0) size 35x13
+      text run at (0,0) width 35: "foobar"
+layer at (370,36) size 130x13
+  RenderBlock {DIV} at (0,0) size 131x13
+    RenderText {#text} at (0,0) size 35x13
+      text run at (0,0) width 35: "foobar"

Modified: trunk/LayoutTests/platform/mac/fast/forms/search-rtl-expected.txt (201396 => 201397)


--- trunk/LayoutTests/platform/mac/fast/forms/search-rtl-expected.txt	2016-05-25 19:39:46 UTC (rev 201396)
+++ trunk/LayoutTests/platform/mac/fast/forms/search-rtl-expected.txt	2016-05-25 19:41:34 UTC (rev 201397)
@@ -18,30 +18,30 @@
       RenderBlock {P} at (0,34) size 784x69
         RenderTextControl {INPUT} at (2,2) size 178x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
           RenderFlexibleBox {DIV} at (3,0) size 172x19
-            RenderBlock {DIV} at (0,0) size 22x19
-            RenderBlock {DIV} at (22,3) size 131x13
-            RenderBlock {DIV} at (152,0) size 20x19
+            RenderBlock {DIV} at (149,0) size 23x19
+            RenderBlock {DIV} at (19,3) size 131x13
+            RenderBlock {DIV} at (0,0) size 19x19
         RenderText {#text} at (181,2) size 5x18
           text run at (181,2) width 5: " "
         RenderBR {BR} at (0,0) size 0x0
         RenderTextControl {INPUT} at (2,25) size 243x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
           RenderFlexibleBox {DIV} at (3,0) size 237x19
-            RenderBlock {DIV} at (0,0) size 22x19
-            RenderBlock {DIV} at (22,3) size 196x13
-            RenderBlock {DIV} at (217,0) size 20x19
+            RenderBlock {DIV} at (214,0) size 23x19
+            RenderBlock {DIV} at (19,3) size 196x13
+            RenderBlock {DIV} at (0,0) size 19x19
         RenderText {#text} at (246,25) size 5x18
           text run at (246,25) width 5: " "
         RenderBR {BR} at (0,0) size 0x0
         RenderTextControl {INPUT} at (2,48) size 178x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
           RenderFlexibleBox {DIV} at (3,0) size 172x19
-            RenderBlock {DIV} at (0,0) size 22x19
-            RenderBlock {DIV} at (22,3) size 131x13
-            RenderBlock {DIV} at (152,0) size 20x19
+            RenderBlock {DIV} at (149,0) size 23x19
+            RenderBlock {DIV} at (19,3) size 131x13
+            RenderBlock {DIV} at (0,0) size 19x19
         RenderText {#text} at (0,0) size 0x0
       RenderBlock {P} at (0,119) size 784x18
         RenderText {#text} at (0,0) size 37x18
           text run at (0,0) width 37: "PASS"
-layer at (35,47) size 130x13 scrollX 3 scrollWidth 134
+layer at (32,47) size 130x13 scrollX 3 scrollWidth 134
   RenderBlock {DIV} at (0,0) size 131x13
     RenderText {#text} at (-3,0) size 135x13
       text run at (-3,0) width 22 RTL: " \x{5D5}\x{5D6}\x{5D4}\x{5D5}"
@@ -49,7 +49,7 @@
       text run at (37,0) width 44 RTL: " \x{5D5}\x{5D4}\x{5D9}\x{5D0} \x{5D6}\x{5D4} "
       text run at (80,0) width 14: "he"
       text run at (93,0) width 38 RTL: "\x{5D4}\x{5D5}\x{5D0} \x{5D6}\x{5D4} "
-layer at (35,70) size 196x13
+layer at (32,70) size 196x13
   RenderBlock {DIV} at (0,0) size 196x13
     RenderText {#text} at (61,0) size 135x13
       text run at (61,0) width 23 RTL: " \x{5D5}\x{5D6}\x{5D4}\x{5D5}"
@@ -57,6 +57,6 @@
       text run at (102,0) width 44 RTL: " \x{5D5}\x{5D4}\x{5D9}\x{5D0} \x{5D6}\x{5D4} "
       text run at (145,0) width 14: "he"
       text run at (158,0) width 38 RTL: "\x{5D4}\x{5D5}\x{5D0} \x{5D6}\x{5D4} "
-layer at (35,93) size 130x13
+layer at (32,93) size 130x13
   RenderBlock {DIV} at (0,0) size 131x13
 caret: position 0 of child 0 {DIV} of child 1 {DIV} of child 0 {DIV} of {#document-fragment} of child 9 {INPUT} of child 3 {P} of body

Modified: trunk/Source/WebCore/ChangeLog (201396 => 201397)


--- trunk/Source/WebCore/ChangeLog	2016-05-25 19:39:46 UTC (rev 201396)
+++ trunk/Source/WebCore/ChangeLog	2016-05-25 19:41:34 UTC (rev 201397)
@@ -1,3 +1,18 @@
+2016-05-25  Zalan Bujtas  <[email protected]>
+
+        Swap search field's cancel and result button for RTL content.
+        https://bugs.webkit.org/show_bug.cgi?id=158007
+
+        Reviewed by Dean Jackson.
+
+        Test: fast/forms/search-input-rtl.html
+
+        * css/html.css:
+        (input[type="search"]::-webkit-textfield-decoration-container): Deleted.
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
+        (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
+
 2016-05-25  Myles C. Maxfield  <[email protected]>
 
         [Font Loading] ASSERT if calling FontFace.loaded twice with a garbage collection between them

Modified: trunk/Source/WebCore/css/html.css (201396 => 201397)


--- trunk/Source/WebCore/css/html.css	2016-05-25 19:39:46 UTC (rev 201396)
+++ trunk/Source/WebCore/css/html.css	2016-05-25 19:41:34 UTC (rev 201397)
@@ -411,10 +411,6 @@
     content: none !important;
 }
 
-input[type="search"]::-webkit-textfield-decoration-container {
-    direction: ltr;
-}
-
 input::-webkit-clear-button {
     -webkit-appearance: searchfield-cancel-button;
     display: inline-block;

Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (201396 => 201397)


--- trunk/Source/WebCore/rendering/RenderThemeMac.mm	2016-05-25 19:39:46 UTC (rev 201396)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm	2016-05-25 19:41:34 UTC (rev 201397)
@@ -1739,6 +1739,14 @@
     float zoomLevel = box.style().effectiveZoom();
 
     FloatRect localBounds = adjustedCancelButtonRect([search cancelButtonRectForBounds:NSRect(snappedIntRect(inputBox.contentBoxRect()))]);
+    // Adjust position based on the content direction.
+    float adjustedXPosition;
+    if (box.style().direction() == RTL)
+        adjustedXPosition = inputBox.contentBoxRect().x();
+    else
+        adjustedXPosition = inputBox.contentBoxRect().maxX() - localBounds.size().width();
+    
+    localBounds.setX(adjustedXPosition);
     FloatPoint paintingPos = convertToPaintingPosition(inputBox, box, localBounds.location(), r.location());
 
     FloatRect unzoomedRect(paintingPos, localBounds.size());
@@ -1868,6 +1876,13 @@
     float zoomLevel = box.style().effectiveZoom();
 
     FloatRect localBounds = adjustedResultButtonRect([search searchButtonRectForBounds:NSRect(snappedIntRect(inputBox.contentBoxRect()))]);
+    // Adjust position based on the content direction.
+    float adjustedXPosition;
+    if (box.style().direction() == RTL)
+        adjustedXPosition = inputBox.contentBoxRect().maxX() - localBounds.size().width();
+    else
+        adjustedXPosition = inputBox.contentBoxRect().x();
+    localBounds.setX(adjustedXPosition);
     FloatPoint paintingPos = convertToPaintingPosition(inputBox, box, localBounds.location(), r.location());
     
     FloatRect unzoomedRect(paintingPos, localBounds.size());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to