Bug 1464412 - Flip vertical resizers on rtl sites r=dao draft
authorTimothy Guan-tin Chien <timdream@gmail.com>
Sat, 26 May 2018 10:18:19 +0800
changeset 800174 2e8b3492826ed05d2471f7aab25d371140039182
parent 798564 9055d9d89a4bca5cf48dda789299559aefca4e54
push id111289
push usertimdream@gmail.com
push dateSat, 26 May 2018 02:24:45 +0000
reviewersdao
bugs1464412
milestone62.0a1
Bug 1464412 - Flip vertical resizers on rtl sites r=dao MozReview-Commit-ID: E0ejPUUCJiJ
layout/generic/nsGfxScrollFrame.cpp
layout/reftests/forms/textarea/reftest.list
layout/reftests/forms/textarea/resize-rtl-vertical.html
layout/reftests/forms/textarea/resize-vertical.html
toolkit/content/minimal-xul.css
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -4709,16 +4709,19 @@ ScrollFrameHelper::CreateAnonymousConten
           dir.AssignLiteral("right");
         }
         else {
           dir.AssignLiteral("left");
         }
         break;
       case NS_STYLE_RESIZE_VERTICAL:
         dir.AssignLiteral("bottom");
+        if (!IsScrollbarOnRight()) {
+          mResizerContent->SetAttr(kNameSpaceID_None, nsGkAtoms::flip, EmptyString(), false);
+        }
         break;
       case NS_STYLE_RESIZE_BOTH:
         if (IsScrollbarOnRight()) {
           dir.AssignLiteral("bottomright");
         }
         else {
           dir.AssignLiteral("bottomleft");
         }
--- a/layout/reftests/forms/textarea/reftest.list
+++ b/layout/reftests/forms/textarea/reftest.list
@@ -1,10 +1,12 @@
 skip-if(Android) == resize.html resize-ref.html
+skip-if(Android) == resize-vertical.html resize-ref.html
 skip-if(Android) == resize-rtl.html resize-rtl-ref.html
+skip-if(Android) == resize-rtl-vertical.html resize-rtl-ref.html
 # an offset seems to apply to the native resizer on windows so skip this test for now
 skip-if(Android) skip-if(winWidget) fuzzy-if(cocoaWidget,1,33) fuzzy-if(skiaContent&&!winWidget&&!Android,5,10) == resize-background.html resize-background-ref.html
 skip-if(Android) != ltr.html rtl.html
 skip-if(Android) != ltr-scrollbar.html rtl-scrollbar.html
 skip-if(Android) != in-ltr-doc-scrollbar.html in-rtl-doc-scrollbar.html
 skip-if(Android) != ltr.html no-resize.html
 skip-if(Android) != rtl.html no-resize.html # bug 834724
 fuzzy-if(skiaContent,1,1) == rtl.html rtl-dynamic-attr.html
copy from layout/reftests/forms/textarea/resize-rtl.html
copy to layout/reftests/forms/textarea/resize-rtl-vertical.html
--- a/layout/reftests/forms/textarea/resize-rtl.html
+++ b/layout/reftests/forms/textarea/resize-rtl-vertical.html
@@ -1,3 +1,3 @@
 <html><body>
-<textarea dir="rtl" style="-moz-appearance: none; background: white; border: 0; padding: 0; margin: 0; width: 100px; height: 100px;" resizable="false" multiline="true" width="100" height="100"></textarea>
+<textarea dir="rtl" style="resize: vertical; -moz-appearance: none; background: white; border: 0; padding: 0; margin: 0; width: 100px; height: 100px;" resizable="false" multiline="true" width="100" height="100"></textarea>
 </body></html>
copy from layout/reftests/forms/textarea/resize.html
copy to layout/reftests/forms/textarea/resize-vertical.html
--- a/layout/reftests/forms/textarea/resize.html
+++ b/layout/reftests/forms/textarea/resize-vertical.html
@@ -1,3 +1,3 @@
 <html><body>
-<textarea style="-moz-appearance: none; background: white; border: 0; padding: 0; margin: 0; width: 100px; height: 100px;" resizable="false" multiline="true" width="100" height="100"></textarea>
+<textarea style="resize: vertical; -moz-appearance: none; background: white; border: 0; padding: 0; margin: 0; width: 100px; height: 100px;" resizable="false" multiline="true" width="100" height="100"></textarea>
 </body></html>
--- a/toolkit/content/minimal-xul.css
+++ b/toolkit/content/minimal-xul.css
@@ -88,20 +88,26 @@ resizer {
   background: url("chrome://global/skin/icons/resizer.svg") no-repeat;
   background-size: 100% 100%;
   cursor: se-resize;
   width: 15px;
   height: 15px;
 }
 
 /* bottomstart/bottomend is supported in XUL window only */
+resizer[dir="bottom"][flip],
 resizer[dir="bottomleft"],
 resizer[dir="bottomstart"]:-moz-locale-dir(ltr),
 resizer[dir="bottomend"]:-moz-locale-dir(rtl) {
   transform: scaleX(-1);
+}
+
+resizer[dir="bottomleft"],
+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;
 }