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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Brian Grinstead 2018-11-16 17:50:04 +00:00
Родитель 6d17917258
Коммит de723eccb2
3 изменённых файлов: 3 добавлений и 29 удалений

Просмотреть файл

@ -7,29 +7,6 @@
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">

Просмотреть файл

@ -478,13 +478,12 @@ notification[value="translation"] menulist > .menulist-dropmarker {
}
#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");
}
}

Просмотреть файл

@ -20,9 +20,7 @@
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) {}
}