Bug 1500424 - Remove customizable ui toolbar-drag binding;r=Gijs
authorBrian Grinstead <bgrinstead@mozilla.com>
Fri, 16 Nov 2018 17:50:04 +0000
changeset 503238 ae7984aa48035013da1f4f5431748221be279b70
parent 503237 32b7fb77f82ca4389cb4746d7962f93865891c1d
child 503239 962527f12004f42c50cddd1475cdb7d62c91134c
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1500424
milestone65.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 1500424 - Remove customizable ui toolbar-drag binding;r=Gijs It was almost identical to the toolkit version, only missing a [customizing=true] check to prevent drag. Since Customization only happens in browser/ we are able to replace the toolkit version with the CUI version, and then remove the CUI version. The `#toolbar-menubar:not([autohide="true"])` selector will fall back to the `toolbar[type="menubar"]` selector in global.css to apply the toolkit one, so that is removed from browser.css. Differential Revision: https://phabricator.services.mozilla.com/D12146
browser/components/customizableui/content/toolbar.xml
browser/themes/linux/browser.css
toolkit/content/widgets/toolbar.xml
--- a/browser/components/customizableui/content/toolbar.xml
+++ b/browser/components/customizableui/content/toolbar.xml
@@ -2,39 +2,16 @@
 <!-- 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/. -->
 
 <bindings id="browserToolbarBindings"
           xmlns="http://www.mozilla.org/xbl"
           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
           xmlns:xbl="http://www.mozilla.org/xbl">
-  <!-- The toolbar-drag binding is almost a verbatim copy of its toolkit counterpart,
-       but it inherits from the customizableui's toolbar binding instead of toolkit's.
-       This functionality will move into CustomizableUI proper as part of our move
-       away from XBL. -->
-  <binding id="toolbar-drag">
-    <implementation>
-      <field name="_dragBindingAlive">true</field>
-      <constructor><![CDATA[
-        if (!this._draggableStarted) {
-          this._draggableStarted = true;
-          try {
-            let tmp = {};
-            ChromeUtils.import("resource://gre/modules/WindowDraggingUtils.jsm", tmp);
-            let draggableThis = new tmp.WindowDraggingElement(this);
-            draggableThis.mouseDownCheck = function(e) {
-              return this._dragBindingAlive;
-            };
-          } catch (e) {}
-        }
-      ]]></constructor>
-    </implementation>
-  </binding>
-
   <binding id="toolbarpaletteitem">
     <content>
       <xul:hbox class="toolbarpaletteitem-box">
         <children/>
       </xul:hbox>
       <xul:label class="toolbarpaletteitem-label" xbl:inherits="xbl:text=title"/>
     </content>
   </binding>
--- a/browser/themes/linux/browser.css
+++ b/browser/themes/linux/browser.css
@@ -473,23 +473,22 @@ notification[value="translation"] menuli
 }
 
 #TabsToolbar:not(:-moz-lwtheme) {
   -moz-appearance: menubar;
   color: -moz-menubartext;
 }
 
 #nav-bar {
-  -moz-binding: url("chrome://browser/content/customizableui/toolbar.xml#toolbar-drag");
+  -moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbar-drag");
 }
 
 @media (-moz-menubar-drag) {
-  #toolbar-menubar:not([autohide="true"]),
   #TabsToolbar {
-    -moz-binding: url("chrome://browser/content/customizableui/toolbar.xml#toolbar-drag");
+    -moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbar-drag");
   }
 }
 
 .keyboard-focused-tab > .tab-stack > .tab-content,
 .tabbrowser-tab:focus:not([aria-activedescendant]) > .tab-stack > .tab-content {
   outline: 1px dotted;
   outline-offset: -6px;
 }
--- a/toolkit/content/widgets/toolbar.xml
+++ b/toolkit/content/widgets/toolbar.xml
@@ -15,18 +15,16 @@
       <constructor><![CDATA[
         if (!this._draggableStarted) {
           this._draggableStarted = true;
           try {
             let tmp = {};
             ChromeUtils.import("resource://gre/modules/WindowDraggingUtils.jsm", tmp);
             let draggableThis = new tmp.WindowDraggingElement(this);
             draggableThis.mouseDownCheck = function(e) {
-              // Don't move while customizing.
-              return this._dragBindingAlive &&
-                     this.getAttribute("customizing") != "true";
+              return this._dragBindingAlive;
             };
           } catch (e) {}
         }
       ]]></constructor>
     </implementation>
   </binding>
 </bindings>