Bug 1235780 - Remove preprocessing from floating scrollbar css. r=jryans
authorAlexandre Poirot <poirot.alex@gmail.com>
Mon, 25 Jan 2016 06:06:47 -0800
changeset 281489 1bcd7705d2dc1610850ae01c221f55a6249a14cd
parent 281488 48571bf11be832658eabe82402739b4f42428d98
child 281490 a4fe93d921adf9b2a5bd230cfe718d1ba64bccfa
push id17206
push userapoirot@mozilla.com
push dateMon, 25 Jan 2016 14:07:08 +0000
treeherderfx-team@1747520ecc13 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjryans
bugs1235780
milestone46.0a1
Bug 1235780 - Remove preprocessing from floating scrollbar css. r=jryans
devtools/client/jar.mn
devtools/client/responsivedesign/responsivedesign-child.js
devtools/client/shared/theme-switching.js
devtools/client/themes/floating-scrollbars-dark-theme.css
devtools/client/themes/floating-scrollbars-light.css
devtools/client/themes/floating-scrollbars-responsive-design.css
devtools/client/themes/floating-scrollbars.css
--- a/devtools/client/jar.mn
+++ b/devtools/client/jar.mn
@@ -274,18 +274,18 @@ devtools.jar:
     skin/images/responsivemode/responsiveui-screenshot@2x.png (themes/images/responsivemode/responsiveui-screenshot@2x.png)
     skin/images/responsivemode/responsiveui-home.png (themes/images/responsivemode/responsiveui-home.png)
     skin/images/toggle-tools.png (themes/images/toggle-tools.png)
     skin/images/toggle-tools@2x.png (themes/images/toggle-tools@2x.png)
     skin/images/dock-bottom@2x.png (themes/images/dock-bottom@2x.png)
     skin/images/dock-bottom-minimize@2x.png (themes/images/dock-bottom-minimize@2x.png)
     skin/images/dock-bottom-maximize@2x.png (themes/images/dock-bottom-maximize@2x.png)
     skin/images/dock-side@2x.png (themes/images/dock-side@2x.png)
-*   skin/floating-scrollbars.css (themes/floating-scrollbars.css)
-    skin/floating-scrollbars-light.css (themes/floating-scrollbars-light.css)
+    skin/floating-scrollbars-dark-theme.css (themes/floating-scrollbars-dark-theme.css)
+    skin/floating-scrollbars-responsive-design.css (themes/floating-scrollbars-responsive-design.css)
     skin/inspector.css (themes/inspector.css)
     skin/images/profiler-stopwatch.svg (themes/images/profiler-stopwatch.svg)
     skin/images/emojis/emoji-command-pick.svg (themes/images/emojis/emoji-command-pick.svg)
     skin/images/emojis/emoji-tool-webconsole.svg (themes/images/emojis/emoji-tool-webconsole.svg)
     skin/images/emojis/emoji-tool-canvas.svg (themes/images/emojis/emoji-tool-canvas.svg)
     skin/images/emojis/emoji-tool-debugger.svg (themes/images/emojis/emoji-tool-debugger.svg)
     skin/images/emojis/emoji-tool-inspector.svg (themes/images/emojis/emoji-tool-inspector.svg)
     skin/images/emojis/emoji-tool-shadereditor.svg (themes/images/emojis/emoji-tool-shadereditor.svg)
--- a/devtools/client/responsivedesign/responsivedesign-child.js
+++ b/devtools/client/responsivedesign/responsivedesign-child.js
@@ -1,15 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var Ci = Components.interfaces;
 const gDeviceSizeWasPageSize = docShell.deviceSizeIsPageSize;
-const gFloatingScrollbarsStylesheet = Services.io.newURI("chrome://devtools/skin/floating-scrollbars.css", null, null);
+const gFloatingScrollbarsStylesheet = Services.io.newURI("chrome://devtools/skin/floating-scrollbars-responsive-design.css", null, null);
 var gRequiresFloatingScrollbars;
 
 var active = false;
 
 addMessageListener("ResponsiveMode:Start", startResponsiveMode);
 addMessageListener("ResponsiveMode:Stop", stopResponsiveMode);
 
 function startResponsiveMode({data:data}) {
--- a/devtools/client/shared/theme-switching.js
+++ b/devtools/client/shared/theme-switching.js
@@ -1,14 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 (function() {
-  const SCROLLBARS_URL = "chrome://devtools/skin/floating-scrollbars-light.css";
+  const SCROLLBARS_URL = "chrome://devtools/skin/floating-scrollbars-dark-theme.css";
   let documentElement = document.documentElement;
 
   let os;
   let platform = navigator.platform;
   if (platform.startsWith("Win")) {
     os = "win";
   } else if (platform.startsWith("Mac")) {
     os = "mac";
rename from devtools/client/themes/floating-scrollbars.css
rename to devtools/client/themes/floating-scrollbars-dark-theme.css
--- a/devtools/client/themes/floating-scrollbars.css
+++ b/devtools/client/themes/floating-scrollbars-dark-theme.css
@@ -1,49 +1,55 @@
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+@namespace xul url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
 
-scrollbar {
+xul|scrollbar {
   -moz-appearance: none !important;
   position: relative;
   background-color: transparent;
   background-image: none;
   z-index: 2147483647;
   padding: 2px;
-%ifdef XP_MACOSX
-  border: 0px solid transparent;
-%endif
+}
+
+:root[platform="mac"] xul|scrollbar {
+  border: none;
 }
 
 /* Scrollbar code will reset the margin to the correct side depending on
    where layout actually puts the scrollbar */
-scrollbar[orient="vertical"] {
+xul|scrollbar[orient="vertical"] {
   margin-left: -10px;
   min-width: 10px;
   max-width: 10px;
 }
 
-scrollbar[orient="horizontal"] {
+xul|scrollbar[orient="horizontal"] {
   margin-top: -10px;
   min-height: 10px;
   max-height: 10px;
 }
 
-%ifdef XP_MACOSX
-slider {
+:root[platform="mac"] xul|slider {
   -moz-appearance: none !important;
 }
 
-thumb {
+:root[platform="mac"] xul|thumb {
   -moz-appearance: none !important;
-  background-color: rgba(0,0,0,0.2);
   border-radius: 3px;
 }
-%else
-scrollbar thumb {
+
+xul|scrollbar xul|thumb {
+  background-color: rgba(170,170,170,0.2) !important;
+}
+
+:root[platform="win"] xul|thumb,
+:root[platform="linux"] xul|thumb {
   -moz-appearance: none !important;
   border-width: 0px !important;
-  background-color: rgba(170,170,170,0.2) !important;
   border-radius: 3px !important;
 }
-scrollbar scrollbarbutton, scrollbar gripper {
+
+:root[platform="win"] xul|scrollbar xul|scrollbarbutton,
+:root[platform="linux"] xul|scrollbar xul|scrollbarbutton,
+:root[platform="win"] xul|scrollbar xul|gripper,
+:root[platform="linux"] xul|scrollbar xul|gripper {
   display: none;
 }
-%endif
deleted file mode 100644
--- a/devtools/client/themes/floating-scrollbars-light.css
+++ /dev/null
@@ -1,10 +0,0 @@
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-@import url("floating-scrollbars.css");
-
-scrollbar thumb {
-  background-color: rgba(170,170,170,0.2) !important;
-}
copy from devtools/client/themes/floating-scrollbars.css
copy to devtools/client/themes/floating-scrollbars-responsive-design.css
--- a/devtools/client/themes/floating-scrollbars.css
+++ b/devtools/client/themes/floating-scrollbars-responsive-design.css
@@ -2,48 +2,41 @@
 
 scrollbar {
   -moz-appearance: none !important;
   position: relative;
   background-color: transparent;
   background-image: none;
   z-index: 2147483647;
   padding: 2px;
-%ifdef XP_MACOSX
-  border: 0px solid transparent;
-%endif
+  border: none;
 }
 
 /* Scrollbar code will reset the margin to the correct side depending on
    where layout actually puts the scrollbar */
 scrollbar[orient="vertical"] {
   margin-left: -10px;
   min-width: 10px;
   max-width: 10px;
 }
 
 scrollbar[orient="horizontal"] {
   margin-top: -10px;
   min-height: 10px;
   max-height: 10px;
 }
 
-%ifdef XP_MACOSX
 slider {
   -moz-appearance: none !important;
 }
 
 thumb {
   -moz-appearance: none !important;
   background-color: rgba(0,0,0,0.2);
   border-radius: 3px;
-}
-%else
-scrollbar thumb {
-  -moz-appearance: none !important;
   border-width: 0px !important;
-  background-color: rgba(170,170,170,0.2) !important;
   border-radius: 3px !important;
 }
-scrollbar scrollbarbutton, scrollbar gripper {
+
+scrollbar scrollbarbutton,
+scrollbar gripper {
   display: none;
 }
-%endif