зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central to mozilla-inbound for australis backout
--HG-- extra : amend_source : c72e232f00e11417faabc3eac492edcc704a1003
This commit is contained in:
Коммит
0442bb525b
|
@ -21,7 +21,8 @@ let CustomizationHandler = {
|
|||
},
|
||||
|
||||
isCustomizing: function() {
|
||||
return document.documentElement.hasAttribute("customizing");
|
||||
return document.documentElement.hasAttribute("customizing") ||
|
||||
document.documentElement.hasAttribute("customize-exiting");
|
||||
},
|
||||
|
||||
_customizationStarting: function() {
|
||||
|
|
|
@ -3710,11 +3710,11 @@ var XULBrowserWindow = {
|
|||
// Try not to instantiate gCustomizeMode as much as possible,
|
||||
// so don't use CustomizeMode.jsm to check for URI or customizing.
|
||||
let customizingURI = "about:customizing";
|
||||
if (location == customizingURI) {
|
||||
if (location == customizingURI &&
|
||||
!CustomizationHandler.isCustomizing()) {
|
||||
gCustomizeMode.enter();
|
||||
} else if (location != customizingURI &&
|
||||
(CustomizationHandler.isEnteringCustomizeMode ||
|
||||
CustomizationHandler.isCustomizing())) {
|
||||
CustomizationHandler.isCustomizing()) {
|
||||
gCustomizeMode.exit();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,13 +73,8 @@ CustomizeMode.prototype = {
|
|||
return this.document.getElementById("PanelUI-contents");
|
||||
},
|
||||
|
||||
get _handler() {
|
||||
return this.window.CustomizationHandler;
|
||||
},
|
||||
|
||||
toggle: function() {
|
||||
if (this._handler.isEnteringCustomizeMode || this._handler.isExitingCustomizeMode) {
|
||||
this._wantToBeInCustomizeMode = !this._wantToBeInCustomizeMode;
|
||||
if (this._transitioning) {
|
||||
return;
|
||||
}
|
||||
if (this._customizing) {
|
||||
|
@ -90,20 +85,10 @@ CustomizeMode.prototype = {
|
|||
},
|
||||
|
||||
enter: function() {
|
||||
this._wantToBeInCustomizeMode = true;
|
||||
|
||||
if (this._customizing || this._handler.isEnteringCustomizeMode) {
|
||||
if (this._customizing || this._transitioning) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Exiting; want to re-enter once we've done that.
|
||||
if (this._handler.isExitingCustomizeMode) {
|
||||
LOG("Attempted to enter while we're in the middle of exiting. " +
|
||||
"We'll exit after we've entered");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// We don't need to switch to kAboutURI, or open a new tab at
|
||||
// kAboutURI if we're already on it.
|
||||
if (this.browser.selectedBrowser.currentURI.spec != kAboutURI) {
|
||||
|
@ -114,8 +99,6 @@ CustomizeMode.prototype = {
|
|||
let window = this.window;
|
||||
let document = this.document;
|
||||
|
||||
this._handler.isEnteringCustomizeMode = true;
|
||||
|
||||
Task.spawn(function() {
|
||||
// We shouldn't start customize mode until after browser-delayed-startup has finished:
|
||||
if (!this.window.gBrowserInit.delayedStartupFinished) {
|
||||
|
@ -218,35 +201,19 @@ CustomizeMode.prototype = {
|
|||
// Show the palette now that the transition has finished.
|
||||
this.visiblePalette.hidden = false;
|
||||
|
||||
this._handler.isEnteringCustomizeMode = false;
|
||||
this.dispatchToolboxEvent("customizationready");
|
||||
if (!this._wantToBeInCustomizeMode) {
|
||||
this.exit();
|
||||
}
|
||||
}.bind(this)).then(null, function(e) {
|
||||
ERROR(e);
|
||||
// We should ensure this has been called, and calling it again doesn't hurt:
|
||||
window.PanelUI.endBatchUpdate();
|
||||
this._handler.isEnteringCustomizeMode = false;
|
||||
}.bind(this));
|
||||
});
|
||||
},
|
||||
|
||||
exit: function() {
|
||||
this._wantToBeInCustomizeMode = false;
|
||||
|
||||
if (!this._customizing || this._handler.isExitingCustomizeMode) {
|
||||
if (!this._customizing || this._transitioning) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Entering; want to exit once we've done that.
|
||||
if (this._handler.isEnteringCustomizeMode) {
|
||||
LOG("Attempted to exit while we're in the middle of entering. " +
|
||||
"We'll exit after we've entered");
|
||||
return;
|
||||
}
|
||||
|
||||
this._handler.isExitingCustomizeMode = true;
|
||||
|
||||
CustomizableUI.removeListener(this);
|
||||
|
||||
this.document.removeEventListener("keypress", this);
|
||||
|
@ -329,13 +296,7 @@ CustomizeMode.prototype = {
|
|||
let custBrowser = this.browser.selectedBrowser;
|
||||
if (custBrowser.canGoBack) {
|
||||
// If there's history to this tab, just go back.
|
||||
// Note that this throws an exception if the previous document has a
|
||||
// problematic URL (e.g. about:idontexist)
|
||||
try {
|
||||
custBrowser.goBack();
|
||||
} catch (ex) {
|
||||
ERROR(ex);
|
||||
}
|
||||
custBrowser.goBack();
|
||||
} else {
|
||||
// If we can't go back, we're removing the about:customization tab.
|
||||
// We only do this if we're the top window for this window (so not
|
||||
|
@ -360,19 +321,13 @@ CustomizeMode.prototype = {
|
|||
this.window.PanelUI.endBatchUpdate();
|
||||
this._changed = false;
|
||||
this._transitioning = false;
|
||||
this._handler.isExitingCustomizeMode = false;
|
||||
this.dispatchToolboxEvent("aftercustomization");
|
||||
CustomizableUI.notifyEndCustomizing(this.window);
|
||||
|
||||
if (this._wantToBeInCustomizeMode) {
|
||||
this.enter();
|
||||
}
|
||||
}.bind(this)).then(null, function(e) {
|
||||
ERROR(e);
|
||||
// We should ensure this has been called, and calling it again doesn't hurt:
|
||||
window.PanelUI.endBatchUpdate();
|
||||
this._handler.isExitingCustomizeMode = false;
|
||||
}.bind(this));
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,7 +19,6 @@ skip-if = os == "mac"
|
|||
[browser_886323_buildArea_removable_nodes.js]
|
||||
[browser_887438_currentset_shim.js]
|
||||
[browser_888817_currentset_updating.js]
|
||||
[browser_889120_customize_tab_merging.js]
|
||||
[browser_890140_orphaned_placeholders.js]
|
||||
[browser_890262_destroyWidget_after_add_to_panel.js]
|
||||
[browser_892955_isWidgetRemovable_for_removed_widgets.js]
|
||||
|
|
|
@ -110,6 +110,7 @@ function checkPalette(id, method) {
|
|||
}
|
||||
|
||||
let otherWin;
|
||||
Services.prefs.setBoolPref("browser.uiCustomization.skipSourceNodeCheck", true);
|
||||
|
||||
// Moving widgets in two windows, one with customize mode and one without, should work.
|
||||
add_task(function MoveWidgetsInTwoWindows() {
|
||||
|
@ -138,5 +139,6 @@ add_task(function MoveWidgetsInTwoWindows() {
|
|||
});
|
||||
|
||||
add_task(function asyncCleanup() {
|
||||
Services.prefs.clearUserPref("browser.uiCustomization.skipSourceNodeCheck");
|
||||
yield resetCustomization();
|
||||
});
|
||||
});
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
Services.prefs.setBoolPref("browser.uiCustomization.skipSourceNodeCheck", true);
|
||||
|
||||
// Dragging an item from the palette to another button in the panel should work.
|
||||
add_task(function() {
|
||||
yield startCustomizing();
|
||||
|
@ -62,5 +64,6 @@ add_task(function() {
|
|||
|
||||
add_task(function asyncCleanup() {
|
||||
yield endCustomizing();
|
||||
Services.prefs.clearUserPref("browser.uiCustomization.skipSourceNodeCheck");
|
||||
yield resetCustomization();
|
||||
});
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
Services.prefs.setBoolPref("browser.uiCustomization.skipSourceNodeCheck", true);
|
||||
requestLongerTimeout(5);
|
||||
|
||||
// Dragging the zoom controls to be before the print button should not move any controls.
|
||||
|
@ -461,5 +462,6 @@ add_task(function() {
|
|||
|
||||
add_task(function asyncCleanup() {
|
||||
yield endCustomizing();
|
||||
Services.prefs.clearUserPref("browser.uiCustomization.skipSourceNodeCheck");
|
||||
yield resetCustomization();
|
||||
});
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
/* 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/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
const kTestToolbarId = "test-empty-drag";
|
||||
|
||||
// Attempting to switch quickly from one tab to another to see whether the state changes
|
||||
// correctly.
|
||||
add_task(function CheckBasicCustomizeMode() {
|
||||
yield startCustomizing();
|
||||
ok(CustomizationHandler.isCustomizing(), "We should be in customize mode");
|
||||
yield endCustomizing();
|
||||
ok(!CustomizationHandler.isCustomizing(), "We should not be in customize mode");
|
||||
});
|
||||
add_task(function CheckQuickCustomizeModeSwitch() {
|
||||
let tab1 = gBrowser.addTab("about:newtab");
|
||||
gBrowser.selectedTab = tab1;
|
||||
let tab2 = gBrowser.addTab("about:customizing");
|
||||
let tab3 = gBrowser.addTab("about:newtab");
|
||||
gBrowser.selectedTab = tab2;
|
||||
try {
|
||||
yield waitForCondition(() => CustomizationHandler.isEnteringCustomizeMode);
|
||||
} catch (ex) {
|
||||
Cu.reportError(ex);
|
||||
}
|
||||
ok(CustomizationHandler.isEnteringCustomizeMode, "Should be entering customize mode");
|
||||
gBrowser.selectedTab = tab3;
|
||||
try {
|
||||
yield waitForCondition(() => !CustomizationHandler.isEnteringCustomizeMode && !CustomizationHandler.isCustomizing());
|
||||
} catch (ex) {
|
||||
Cu.reportError(ex);
|
||||
}
|
||||
ok(!CustomizationHandler.isCustomizing(), "Should not be entering customize mode");
|
||||
gBrowser.removeTab(tab1);
|
||||
gBrowser.removeTab(tab2);
|
||||
gBrowser.removeTab(tab3);
|
||||
});
|
||||
|
||||
add_task(function asyncCleanup() {
|
||||
yield endCustomizing();
|
||||
});
|
||||
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
Services.prefs.setBoolPref("browser.uiCustomization.skipSourceNodeCheck", true);
|
||||
|
||||
// One orphaned item should have two placeholders next to it.
|
||||
add_task(function() {
|
||||
yield startCustomizing();
|
||||
|
@ -156,6 +158,7 @@ add_task(function() {
|
|||
|
||||
add_task(function asyncCleanup() {
|
||||
yield endCustomizing();
|
||||
Services.prefs.clearUserPref("browser.uiCustomization.skipSourceNodeCheck");
|
||||
yield resetCustomization();
|
||||
});
|
||||
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
let navbar;
|
||||
let skippedItem;
|
||||
|
||||
Services.prefs.setBoolPref("browser.uiCustomization.skipSourceNodeCheck", true);
|
||||
|
||||
// Attempting to drag a skipintoolbarset item should work.
|
||||
add_task(function() {
|
||||
navbar = document.getElementById("nav-bar");
|
||||
|
@ -33,5 +35,6 @@ add_task(function() {
|
|||
add_task(function asyncCleanup() {
|
||||
yield endCustomizing();
|
||||
skippedItem.remove();
|
||||
Services.prefs.clearUserPref("browser.uiCustomization.skipSourceNodeCheck");
|
||||
yield resetCustomization();
|
||||
});
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
Services.prefs.setBoolPref("browser.uiCustomization.skipSourceNodeCheck", true);
|
||||
|
||||
// Customize mode reset button should revert correctly
|
||||
add_task(function() {
|
||||
yield startCustomizing();
|
||||
|
@ -21,5 +23,6 @@ add_task(function() {
|
|||
});
|
||||
|
||||
add_task(function asyncCleanup() {
|
||||
Services.prefs.clearUserPref("browser.uiCustomization.skipSourceNodeCheck");
|
||||
yield resetCustomization();
|
||||
});
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
"use strict";
|
||||
|
||||
const kTestToolbarId = "test-empty-drag";
|
||||
Services.prefs.setBoolPref("browser.uiCustomization.skipSourceNodeCheck", true);
|
||||
|
||||
// Attempting to drag an item to an empty container should work.
|
||||
add_task(function() {
|
||||
|
@ -22,5 +23,6 @@ add_task(function() {
|
|||
|
||||
add_task(function asyncCleanup() {
|
||||
yield endCustomizing();
|
||||
Services.prefs.clearUserPref("browser.uiCustomization.skipSourceNodeCheck");
|
||||
yield resetCustomization();
|
||||
});
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
Services.prefs.setBoolPref("browser.uiCustomization.skipSourceNodeCheck", true);
|
||||
|
||||
// Attempting to drag the menubar to the navbar shouldn't work.
|
||||
add_task(function() {
|
||||
yield startCustomizing();
|
||||
|
@ -21,5 +23,6 @@ add_task(function() {
|
|||
|
||||
add_task(function asyncCleanup() {
|
||||
yield endCustomizing();
|
||||
Services.prefs.clearUserPref("browser.uiCustomization.skipSourceNodeCheck");
|
||||
yield resetCustomization();
|
||||
});
|
||||
|
|
|
@ -14,9 +14,6 @@ let ChromeUtils = {};
|
|||
let scriptLoader = Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader);
|
||||
scriptLoader.loadSubScript("chrome://mochikit/content/tests/SimpleTest/ChromeUtils.js", ChromeUtils);
|
||||
|
||||
Services.prefs.setBoolPref("browser.uiCustomization.skipSourceNodeCheck", true);
|
||||
registerCleanupFunction(() => Services.prefs.clearUserPref("browser.uiCustomization.skipSourceNodeCheck"));
|
||||
|
||||
let {synthesizeDragStart, synthesizeDrop} = ChromeUtils;
|
||||
|
||||
const kNSXUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
||||
|
|
|
@ -58,30 +58,38 @@
|
|||
}
|
||||
|
||||
toolbarpaletteitem {
|
||||
transition: border-width 250ms ease-in-out;
|
||||
transition: background-color, border-color, box-shadow, border-width;
|
||||
transition-duration: 10ms, 10ms, 10ms, 250ms;
|
||||
transition-timing-function: linear, linear, linear, ease-in-out;
|
||||
}
|
||||
|
||||
toolbarpaletteitem[mousedown] {
|
||||
box-shadow: inset 0 0 3px hsl(204,100%,40%);
|
||||
cursor: -moz-grabbing;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.panel-customization-placeholder,
|
||||
toolbarpaletteitem[place="palette"],
|
||||
toolbarpaletteitem[place="panel"] {
|
||||
transition: transform .3s ease-in-out;
|
||||
transition: background-color, border-color, box-shadow, transform;
|
||||
transition-duration: 10ms, 10ms, 10ms, 250ms;
|
||||
transition-timing-function: linear, linear, linear, ease-in-out;
|
||||
}
|
||||
|
||||
toolbarpaletteitem[notransition][place="palette"],
|
||||
toolbarpaletteitem[notransition][place="panel"] {
|
||||
transition: none;
|
||||
transition: background-color, border-color, box-shadow;
|
||||
transition-duration: 10ms, 10ms, 10ms;
|
||||
transition-timing-function: linear, linear, linear;
|
||||
}
|
||||
|
||||
toolbarpaletteitem > toolbarbutton > .toolbarbutton-icon {
|
||||
transition: transform .3s cubic-bezier(.6, 2, .75, 1.5);
|
||||
transition: transform 50ms ease-in-out;
|
||||
}
|
||||
|
||||
toolbarpaletteitem[mousedown] > toolbarbutton > .toolbarbutton-icon {
|
||||
transform: scale(1.3);
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
/* Override the toolkit styling for items being dragged over. */
|
||||
|
|
Загрузка…
Ссылка в новой задаче