Backed out changeset 051284a3564e (bug 1366813) for apparently causing autophone tests to frequently fail a=backout

MozReview-Commit-ID: 9GUFY9VAGW3

--HG--
extra : rebase_source : 84e593e1870b9ad3559487371d0c692d63e3ad6e
This commit is contained in:
Wes Kocher 2017-07-11 12:39:26 -07:00
Родитель a474e85454
Коммит e06435f389
7 изменённых файлов: 28 добавлений и 95 удалений

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

@ -268,10 +268,6 @@ window:not([chromehidden~="toolbar"]) #nav-bar[nonemptyoverflow] > .overflow-but
-moz-window-dragging: inherit;
}
toolbarpaletteitem {
-moz-window-dragging: no-drag;
}
%ifdef XP_MACOSX
#titlebar-fullscreen-button {
-moz-appearance: -moz-mac-fullscreen-button;
@ -752,18 +748,6 @@ html|input.urlbar-input[textoverflow]:not([focused]) {
visibility: hidden;
}
/* Flexible spacer sizing (matching url bar) */
toolbarpaletteitem[place=toolbar][id^=wrapper-customizableui-special-spring],
toolbarspring {
-moz-box-flex: 1;
min-width: 40px;
}
#nav-bar toolbarpaletteitem[id^=wrapper-customizableui-special-spring],
#nav-bar toolbarspring {
-moz-box-flex: 80;
}
/* ::::: Unified Back-/Forward Button ::::: */
.unified-nav-current {
font-weight: bold;
@ -1375,7 +1359,6 @@ toolbarpaletteitem[place="palette"] {
height: calc(39px + 3em);
margin-inline-end: 24px;
overflow: visible;
vertical-align: top;
}
toolbarpaletteitem[place="palette"][hidden] {

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

@ -519,8 +519,6 @@ var CustomizableUIInternal = {
}
// PROVIDER_SPECIAL gets treated the same as PROVIDER_XUL.
// XXXgijs: this causes bugs in code that depends on widgetWrapper.provider
// giving an accurate answer... filed as bug 1379821
let wrapper = new XULWidgetGroupWrapper(aWidgetId);
gGroupWrapperCache.set(aWidgetId, wrapper);
return wrapper;
@ -1293,6 +1291,9 @@ var CustomizableUIInternal = {
let nodeName = "toolbar" + aId.match(/spring|spacer|separator/)[0];
let node = aDocument.createElementNS(kNSXUL, nodeName);
node.id = this.ensureSpecialWidgetId(aId);
if (nodeName == "toolbarspring") {
node.flex = 1;
}
return node;
},
@ -2730,18 +2731,18 @@ var CustomizableUIInternal = {
},
canWidgetMoveToArea(aWidgetId, aArea) {
// Special widgets can't move to the menu panel.
if (this.isSpecialWidget(aWidgetId) && gAreas.has(aArea) &&
gAreas.get(aArea).get("type") == CustomizableUI.TYPE_MENU_PANEL) {
return false;
}
let placement = this.getPlacementOfWidget(aWidgetId);
// Items in the palette can move, and items can move within their area:
if (!placement || placement.area == aArea) {
return true;
if (placement && placement.area != aArea) {
// Special widgets can't move to the menu panel.
if (this.isSpecialWidget(aWidgetId) && gAreas.has(aArea) &&
gAreas.get(aArea).get("type") == CustomizableUI.TYPE_MENU_PANEL) {
return false;
}
// For everything else, just return whether the widget is removable.
return this.isWidgetRemovable(aWidgetId);
}
// For everything else, just return whether the widget is removable.
return this.isWidgetRemovable(aWidgetId);
return true;
},
ensureWidgetPlacedInWindow(aWidgetId, aWindow) {
@ -3814,15 +3815,6 @@ this.CustomizableUI = {
isBuiltinToolbar(aToolbarId) {
return CustomizableUIInternal._builtinToolbars.has(aToolbarId);
},
/**
* Create an instance of a spring, spacer or separator.
* @param aId the type of special widget (spring, spacer or separator)
* @param aDocument the document in which to create it.
*/
createSpecialWidget(aId, aDocument) {
return CustomizableUIInternal.createSpecialWidget(aId, aDocument);
},
};
Object.freeze(this.CustomizableUI);
Object.freeze(this.CustomizableUI.windows);

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

@ -35,10 +35,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeManager",
"resource://gre/modules/LightweightThemeManager.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "SessionStore",
"resource:///modules/sessionstore/SessionStore.jsm");
XPCOMUtils.defineLazyGetter(this, "gWidgetsBundle", function() {
const kUrl = "chrome://browser/locale/customizableui/customizableWidgets.properties";
return Services.strings.createBundle(kUrl);
});
XPCOMUtils.defineLazyPreferenceGetter(this, "gPhotonStructure",
"browser.photon.structure.enabled", false);
@ -847,11 +843,6 @@ CustomizeMode.prototype = {
fragment.appendChild(paletteItem);
}
if (gPhotonStructure) {
let flexSpace = CustomizableUI.createSpecialWidget("spring", this.document);
fragment.appendChild(this.wrapToolbarItem(flexSpace, "palette"));
}
this.visiblePalette.appendChild(fragment);
this._stowedPalette = this.window.gNavToolbox.palette;
this.window.gNavToolbox.palette = this.visiblePalette;
@ -887,18 +878,20 @@ CustomizeMode.prototype = {
let nextChild;
while (paletteChild) {
nextChild = paletteChild.nextElementSibling;
let itemId = paletteChild.firstChild.id;
if (CustomizableUI.isSpecialWidget(itemId)) {
this.visiblePalette.removeChild(paletteChild);
} else {
// XXXunf Currently this doesn't destroy the (now unused) node in the
// API provider case. It would be good to do so, but we need to
// keep strong refs to it in CustomizableUI (can't iterate of
// WeakMaps), and there's the question of what behavior
// wrappers should have if consumers keep hold of them.
let provider = CustomizableUI.getWidget(paletteChild.id).provider;
if (provider == CustomizableUI.PROVIDER_XUL) {
let unwrappedPaletteItem =
await this.deferredUnwrapToolbarItem(paletteChild);
this._stowedPalette.appendChild(unwrappedPaletteItem);
} else if (provider == CustomizableUI.PROVIDER_API) {
// XXXunf Currently this doesn't destroy the (now unused) node. It would
// be good to do so, but we need to keep strong refs to it in
// CustomizableUI (can't iterate of WeakMaps), and there's the
// question of what behavior wrappers should have if consumers
// keep hold of them.
// widget.destroyInstance(widgetNode);
} else if (provider == CustomizableUI.PROVIDER_SPECIAL) {
this.visiblePalette.removeChild(paletteChild);
}
paletteChild = nextChild;
@ -1034,10 +1027,6 @@ CustomizeMode.prototype = {
wrapper.addEventListener("mouseup", this);
}
if (CustomizableUI.isSpecialWidget(aNode.id)) {
wrapper.setAttribute("title", gWidgetsBundle.GetStringFromName(aNode.nodeName + ".label"));
}
return wrapper;
},
@ -2070,11 +2059,6 @@ CustomizeMode.prototype = {
}
let position = placement ? placement.position : null;
// Force creating a new spacer/spring/separator if dragging from the palette
if (CustomizableUI.isSpecialWidget(aDraggedItemId) && aOriginArea.id == kPaletteId) {
aDraggedItemId = aDraggedItemId.match(/^customizableui-special-(spring|spacer|separator)/)[1];
}
// Is the target area the same as the origin? Since we've already handled
// the possibility that the target is the customization palette, we know
// that the widget is moving within a customizable area.

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

@ -61,8 +61,9 @@ add_task(async function checkAddingToToolbar() {
add_task(async function checkDragging() {
await SpecialPowers.pushPrefEnv({set: [["browser.photon.structure.enabled", false]]});
let startArea = CustomizableUI.AREA_NAVBAR;
let targetArea = gPhotonStructure ? CustomizableUI.AREA_FIXED_OVERFLOW_PANEL : CustomizableUI.AREA_PANEL;
let targetArea = CustomizableUI.AREA_PANEL;
let startingToolbarPlacements = getAreaWidgetIds(startArea);
let startingTargetPlacements = getAreaWidgetIds(targetArea);
@ -80,11 +81,6 @@ add_task(async function checkDragging() {
is(elementsToMove.length, 3, "Should have 3 elements to try and drag.");
await startCustomizing();
let existingSpecial = null;
if (gPhotonStructure) {
existingSpecial = gCustomizeMode.visiblePalette.querySelector("toolbarspring");
ok(existingSpecial, "Should have a flexible space in the palette by default in photon");
}
for (let id of elementsToMove) {
simulateItemDragAndEnd(document.getElementById(id), PanelUI.contents);
}
@ -99,10 +95,8 @@ add_task(async function checkDragging() {
assertAreaPlacements(startArea, startingToolbarPlacements);
assertAreaPlacements(targetArea, startingTargetPlacements);
let allSpecials = gCustomizeMode.visiblePalette.querySelectorAll("toolbarspring,toolbarseparator,toolbarspacer");
allSpecials = [...allSpecials].filter(special => special != existingSpecial);
ok(!allSpecials.length,
"No (new) specials should make it to the palette alive.");
ok(!gCustomizeMode.visiblePalette.querySelector("toolbarspring,toolbarseparator,toolbarspacer"),
"No specials should make it to the palette alive.");
await endCustomizing();
});

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

@ -109,7 +109,3 @@ devtools-webide-button2.tooltiptext = Open WebIDE (%S)
e10s-button.label = New Non-e10s Window
e10s-button.tooltiptext = Open a new Non-e10s Window
toolbarspring.label = Flexible Space
toolbarseparator.label = Separator
toolbarspacer.label = Space

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

@ -371,21 +371,6 @@ toolbarpaletteitem[place="toolbar"]:not([mousedown="true"]):-moz-focusring {
outline-offset: -5px;
}
toolbarpaletteitem[place=palette] > toolbarspring {
width: 7em;
min-width: 7em;
outline: 1px solid GrayText;
outline-offset: -8px;
height: 37px;
}
toolbarpaletteitem[place=toolbar] > toolbarspring {
outline: 1px solid GrayText;
outline-offset: -2px;
margin-top: 5px;
margin-bottom: 5px;
}
:root:not([photon-structure]) #wrapper-edit-controls[place="palette"] > #edit-controls > toolbarbutton,
:root:not([photon-structure]) #wrapper-edit-controls[place="palette"] > #edit-controls > separator,
:root:not([photon-structure]) #wrapper-zoom-controls[place="palette"] > #zoom-controls > toolbarbutton,

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

@ -1603,7 +1603,6 @@ toolbarpaletteitem[place="palette"] > .toolbarbutton-1 > .toolbarbutton-menubutt
toolbarpaletteitem[place="palette"] > #search-container {
min-width: 7em;
width: 7em;
min-height: 37px;
}
.toolbaritem-combined-buttons@inAnyPanel@ {