From e6a0db03b868a7e943f4ad429bcc279137035a19 Mon Sep 17 00:00:00 2001 From: Timothy Guan-tin Chien Date: Tue, 10 Apr 2018 21:25:15 +0800 Subject: [PATCH] Bug 1450017 - Part V, Remove rtl="true" attribute from resizer r=enndeakin+6102 This patch changes the direction context the dir=bottomend/bottomstart value from the CSS direction property value to locale dir, with the help from :-moz-locale-dir(rtl) selector. The change is justified because: - In the web content, we have since rely on the nsScrollFrame to set the direction explicity. - XUL window should always render in the application locale; it should be fine to disregard direction property set in the local document DOM teee, as it is unlikely to be differ than the locale dir. This remove the one last bit of JavaScript from the resizer binding. MozReview-Commit-ID: AweJ5GARNUE --HG-- extra : rebase_source : 17772435a1f9cfdbc7289eb41d69e5922ffdb302 extra : source : edfba1676e4bb74e32cc987d851f7a6b12abef3b --- layout/xul/test/window_resizer.xul | 2 +- toolkit/content/widgets/resizer.xml | 23 ----------------------- toolkit/themes/osx/global/resizer.css | 10 ++++------ toolkit/themes/windows/global/resizer.css | 7 +++---- 4 files changed, 8 insertions(+), 34 deletions(-) diff --git a/layout/xul/test/window_resizer.xul b/layout/xul/test/window_resizer.xul index 4e349d125ca3..1d21e0df07e1 100644 --- a/layout/xul/test/window_resizer.xul +++ b/layout/xul/test/window_resizer.xul @@ -81,7 +81,7 @@ function doTest() { // now check the cursors in rtl. The bottomend resizer // should be reversed - document.getElementById("bottomend").setAttribute("rtl", "true"); + document.documentElement.setAttribute("localedir", "rtl"); Array.forEach(resizers, function (element) { is(getComputedStyle(element, "").cursor, element.dir == "bottomend" ? "sw-resize" : diff --git a/toolkit/content/widgets/resizer.xml b/toolkit/content/widgets/resizer.xml index f28399c899ef..7faf77656956 100644 --- a/toolkit/content/widgets/resizer.xml +++ b/toolkit/content/widgets/resizer.xml @@ -11,29 +11,6 @@ - - - - - diff --git a/toolkit/themes/osx/global/resizer.css b/toolkit/themes/osx/global/resizer.css index 18cdd2bc9304..dd1fc419b442 100644 --- a/toolkit/themes/osx/global/resizer.css +++ b/toolkit/themes/osx/global/resizer.css @@ -25,13 +25,11 @@ resizer[type="window"] { display: none; } -resizer[rtl="true"], -resizer[dir="bottomend"]:-moz-locale-dir(rtl) { +resizer:-moz-locale-dir(rtl) { background: url("chrome://global/skin/icons/resizer-rtl.png") no-repeat; } @media (min-resolution: 2dppx) { - resizer[rtl="true"], - resizer[dir="bottomend"]:-moz-locale-dir(rtl) { + resizer:-moz-locale-dir(rtl) { background-image: url("chrome://global/skin/icons/resizer-rtl@2x.png"); background-size: 100% 100%; } @@ -45,8 +43,8 @@ resizer[dir="bottomstart"] { } resizer[dir="bottomleft"], -resizer[dir="bottomstart"]:not([rtl="true"]):not(:-moz-locale-dir(rtl)), -resizer[dir="bottomend"][rtl="true"] { +resizer[dir="bottomstart"]:not(:-moz-locale-dir(rtl)), +resizer[dir="bottomend"]:-moz-locale-dir(rtl) { cursor: sw-resize; } diff --git a/toolkit/themes/windows/global/resizer.css b/toolkit/themes/windows/global/resizer.css index 8108d7e85ad3..c58f578aff6e 100644 --- a/toolkit/themes/windows/global/resizer.css +++ b/toolkit/themes/windows/global/resizer.css @@ -13,8 +13,7 @@ resizer { height: 15px; } -resizer[rtl="true"], -resizer[dir="bottomend"]:-moz-locale-dir(rtl) { +resizer:-moz-locale-dir(rtl) { background: url("chrome://global/skin/icons/resizer-rtl.png") no-repeat; } @@ -25,8 +24,8 @@ resizer[dir="bottomstart"] { } resizer[dir="bottomleft"], -resizer[dir="bottomstart"]:not([rtl="true"]):not(:-moz-locale-dir(rtl)), -resizer[dir="bottomend"][rtl="true"] { +resizer[dir="bottomstart"]:not(:-moz-locale-dir(rtl)), +resizer[dir="bottomend"]:-moz-locale-dir(rtl) { cursor: sw-resize; }