Bug 1464412 - Flip vertical resizers on rtl sites r=dao
authorTimothy Guan-tin Chien <timdream@gmail.com>
Sat, 26 May 2018 10:18:19 +0800
changeset 420212 b72d77bc8c5693bf439b88c7b6a2447a4b92c4da
parent 420211 229a64156f7001ebd008634bc62694a21c53de07
child 420213 b2d1728f92ad2c6f265fd80c5a562ffb7111e8b1
push id34068
push usernerli@mozilla.com
push dateTue, 29 May 2018 21:40:19 +0000
treeherdermozilla-central@5852258260e1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs1464412
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
@@ -4697,16 +4697,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;
 }