Bug 1457722 - Don't flip resizer twice in RTL-locales r=dao draft
authorTimothy Guan-tin Chien <timdream@gmail.com>
Tue, 01 May 2018 14:12:13 -0700
changeset 790732 252aea92ad5bbfa5a8f01aca91c4cbb15bc716bc
parent 790147 d2a4720d1c334b64d88a51678758c27ba8f03c89
push id108560
push usertimdream@gmail.com
push dateWed, 02 May 2018 16:34:24 +0000
reviewersdao
bugs1457722
milestone61.0a1
Bug 1457722 - Don't flip resizer twice in RTL-locales r=dao MozReview-Commit-ID: 6k2AyozxJB9
layout/reftests/native-theme/reftest.list
layout/reftests/native-theme/resizer-bottomleft-rtl.xul
layout/reftests/native-theme/resizer-bottomright-rtl.xul
layout/reftests/xul/reftest.list
layout/reftests/xul/resizer-bottomleft-rtl.xul
layout/reftests/xul/resizer-bottomright-rtl.xul
toolkit/content/minimal-xul.css
--- a/layout/reftests/native-theme/reftest.list
+++ b/layout/reftests/native-theme/reftest.list
@@ -48,20 +48,23 @@ fails-if(Android&&!asyncPan) != 492155-4
 
 # RTL mirroring tests
 == checkbox-not-mirrored-when-rtl.html checkbox-not-mirrored-when-rtl-ref.html
 skip-if(!cocoaWidget) == menulist-mirrored-when-rtl.xul menulist-mirrored-when-rtl-ref.xul
 skip-if(!cocoaWidget) == searchfield-mirrored-when-rtl.xul searchfield-mirrored-when-rtl-ref.xul
 skip-if(!cocoaWidget) == select-mirrored-when-rtl.html select-mirrored-when-rtl-ref.html
 
 != resizer-bottomend.xul blank-window.xul
-random-if(d2d) == resizer-bottomend.xul resizer-bottomright.xul # bug 581086 
+random-if(d2d) == resizer-bottomend.xul resizer-bottomright.xul # bug 581086
 != resizer-bottomend.xul resizer-bottomend-rtl.xul
+# Disabled on Linux (bug 519152), random on Windows (bug 581086)
 skip-if(gtkWidget) != resizer-bottomend-rtl.xul blank-window.xul
-skip-if(gtkWidget) random-if(d2d) == resizer-bottomend-rtl.xul resizer-bottomend-flipped.xul # bug 581086
+skip-if(gtkWidget) random-if(d2d) == resizer-bottomend-rtl.xul resizer-bottomend-flipped.xul
+skip-if(gtkWidget) == resizer-bottomleft-rtl.xul resizer-bottomleft.xul
+skip-if(gtkWidget) == resizer-bottomright-rtl.xul resizer-bottomright.xul
 
 != resizer-bottomstart.xul blank-window.xul
 random-if(d2d) == resizer-bottomstart.xul resizer-bottomleft.xul
 random-if(d2d) == resizer-bottomstart.xul resizer-left.xul
 != resizer-bottomstart.xul resizer-bottomstart-rtl.xul
 skip-if(gtkWidget) != resizer-bottomstart-rtl.xul blank-window.xul
 skip-if(gtkWidget) random-if(d2d) == resizer-bottomstart-rtl.xul resizer-bottomend.xul
 
copy from layout/reftests/native-theme/resizer-bottomleft.xul
copy to layout/reftests/native-theme/resizer-bottomleft-rtl.xul
--- a/layout/reftests/native-theme/resizer-bottomleft.xul
+++ b/layout/reftests/native-theme/resizer-bottomleft-rtl.xul
@@ -1,10 +1,10 @@
 <?xml version="1.0"?>
 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
 
 <window title="Resizer"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" localedir="rtl">
   <hbox>
+    <spacer flex="1"/>
     <resizer dir="bottomleft"/>
-    <spacer flex="1"/>
   </hbox>
 </window>
copy from layout/reftests/native-theme/resizer-bottomright.xul
copy to layout/reftests/native-theme/resizer-bottomright-rtl.xul
--- a/layout/reftests/native-theme/resizer-bottomright.xul
+++ b/layout/reftests/native-theme/resizer-bottomright-rtl.xul
@@ -1,10 +1,10 @@
 <?xml version="1.0"?>
 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
 
 <window title="Resizer"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" localedir="rtl">
   <hbox>
+    <spacer flex="1"/>
     <resizer dir="bottomright"/>
-    <spacer flex="1"/>
   </hbox>
 </window>
--- a/layout/reftests/xul/reftest.list
+++ b/layout/reftests/xul/reftest.list
@@ -83,16 +83,18 @@ test-pref(svg.context-properties.content
 
 != resizer-bottomend.xul blank-window.xul
 == resizer-bottomend.xul resizer-bottomright.xul
 != resizer-bottomend.xul resizer-bottomend-rtl.xul
 != resizer-bottomend-rtl.xul blank-window.xul
 # fuzzy for comparing SVG image flipped by CSS with a flipped SVG image.
 # See bug 1450017 comment 79.
 fuzzy(43,98) == resizer-bottomend-rtl.xul resizer-bottomend-flipped.xul
+fuzzy(43,98) == resizer-bottomleft-rtl.xul resizer-bottomleft.xul
+fuzzy(43,98) == resizer-bottomright-rtl.xul resizer-bottomright.xul
 
 != resizer-bottomstart.xul blank-window.xul
 == resizer-bottomstart.xul resizer-bottomleft.xul
 == resizer-bottomstart.xul resizer-left.xul
 != resizer-bottomstart.xul resizer-bottomstart-rtl.xul
 != resizer-bottomstart-rtl.xul blank-window.xul
 # fuzzy for comparing SVG image flipped by CSS to a flipped SVG image.
 # See bug 1450017 comment 79.
copy from layout/reftests/xul/resizer-bottomleft.xul
copy to layout/reftests/xul/resizer-bottomleft-rtl.xul
--- a/layout/reftests/xul/resizer-bottomleft.xul
+++ b/layout/reftests/xul/resizer-bottomleft-rtl.xul
@@ -1,10 +1,10 @@
 <?xml version="1.0"?>
 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
 
 <window title="Resizer"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" localedir="rtl">
   <hbox>
+    <spacer flex="1"/>
     <resizer dir="bottomleft" style="-moz-appearance: none"/>
-    <spacer flex="1"/>
   </hbox>
 </window>
copy from layout/reftests/xul/resizer-bottomright.xul
copy to layout/reftests/xul/resizer-bottomright-rtl.xul
--- a/layout/reftests/xul/resizer-bottomright.xul
+++ b/layout/reftests/xul/resizer-bottomright-rtl.xul
@@ -1,10 +1,10 @@
 <?xml version="1.0"?>
 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
 
 <window title="Resizer"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" localedir="rtl">
   <hbox>
+    <spacer flex="1"/>
     <resizer dir="bottomright" style="-moz-appearance: none"/>
-    <spacer flex="1"/>
   </hbox>
 </window>
--- a/toolkit/content/minimal-xul.css
+++ b/toolkit/content/minimal-xul.css
@@ -86,24 +86,26 @@ resizer {
 
 /* Do not try to remove the RTL asset and flip it with CSS transform;
    native theme style rely on CSS transfrom below to flip too, when
    replacing the background image. */
 resizer:-moz-locale-dir(rtl) {
   background: url("chrome://global/skin/icons/resizer-rtl.svg") no-repeat;
 }
 
-resizer[dir="left"],
-resizer[dir="bottomleft"],
+resizer[dir="left"]:-moz-locale-dir(ltr),
+resizer[dir="right"]:-moz-locale-dir(rtl),
+resizer[dir="bottomleft"]:-moz-locale-dir(ltr),
+resizer[dir="bottomright"]:-moz-locale-dir(rtl),
 resizer[dir="bottomstart"] {
   transform: scaleX(-1);
 }
 
 resizer[dir="bottomleft"],
-resizer[dir="bottomstart"]:not(:-moz-locale-dir(rtl)),
+resizer[dir="bottomstart"]:-moz-locale-dir(ltr),
 resizer[dir="bottomend"]:-moz-locale-dir(rtl) {
   cursor: sw-resize;
 }
 
 resizer[dir="top"],
 resizer[dir="bottom"] {
   cursor: ns-resize;
 }