Bug 1354117 - don't force border radius to 0 for photon (x-ref
bug 1374315), fix webextension tests, r?kmag
MozReview-Commit-ID: 2HAi5J7uzxP
--- a/browser/components/extensions/ext-browserAction.js
+++ b/browser/components/extensions/ext-browserAction.js
@@ -18,18 +18,16 @@ XPCOMUtils.defineLazyModuleGetter(this,
"resource://gre/modules/TelemetryStopwatch.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ViewPopup",
"resource:///modules/ExtensionPopups.jsm");
XPCOMUtils.defineLazyServiceGetter(this, "DOMUtils",
"@mozilla.org/inspector/dom-utils;1",
"inIDOMUtils");
-XPCOMUtils.defineLazyPreferenceGetter(this, "gPhotonStructure", "browser.photon.structure.enabled");
-
var {
DefaultWeakMap,
} = ExtensionUtils;
Cu.import("resource://gre/modules/ExtensionParent.jsm");
var {
IconDetails,
@@ -51,17 +49,17 @@ const isAncestorOrSelf = (target, node)
};
// WeakMap[Extension -> BrowserAction]
const browserActionMap = new WeakMap();
XPCOMUtils.defineLazyGetter(this, "browserAreas", () => {
return {
"navbar": CustomizableUI.AREA_NAVBAR,
- "menupanel": gPhotonStructure ? CustomizableUI.AREA_FIXED_OVERFLOW_PANEL : CustomizableUI.AREA_PANEL,
+ "menupanel": CustomizableUI.AREA_FIXED_OVERFLOW_PANEL,
"tabstrip": CustomizableUI.AREA_TABSTRIP,
"personaltoolbar": CustomizableUI.AREA_BOOKMARKS,
};
});
this.browserAction = class extends ExtensionAPI {
static for(extension) {
return browserActionMap.get(extension);
@@ -241,21 +239,17 @@ this.browserAction = class extends Exten
return;
}
// Popups are shown only if a popup URL is defined; otherwise
// a "click" event is dispatched. This is done for compatibility with the
// Google Chrome onClicked extension API.
if (this.getProperty(tab, "popup")) {
if (this.widget.areaType == CustomizableUI.TYPE_MENU_PANEL) {
- if (gPhotonStructure) {
- await window.document.getElementById("nav-bar").overflowable.show();
- } else {
- await window.PanelUI.show();
- }
+ await window.document.getElementById("nav-bar").overflowable.show();
}
let event = new window.CustomEvent("command", {bubbles: true, cancelable: true});
widget.node.dispatchEvent(event);
} else {
this.emit("click");
}
}
--- a/browser/components/extensions/test/browser/browser_ext_browserAction_pageAction_icon.js
+++ b/browser/components/extensions/test/browser/browser_ext_browserAction_pageAction_icon.js
@@ -288,38 +288,12 @@ add_task(async function testDetailsObjec
is(isLegacy, test.legacy, "Legacy class should be present?");
await SpecialPowers.popPrefEnv();
}
if (!test.menuResolutions) {
continue;
}
-
-
- if (!gPhotonStructure) {
- // Test icon sizes in the menu panel.
- CustomizableUI.addWidgetToArea(browserActionWidget.id,
- CustomizableUI.AREA_PANEL);
-
- await showBrowserAction(extension);
- browserActionButton = browserActionWidget.forWindow(window).node;
-
- for (let resolution of Object.keys(test.menuResolutions)) {
- await SpecialPowers.pushPrefEnv({set: [[RESOLUTION_PREF, resolution]]});
-
- is(window.devicePixelRatio, +resolution, "window has the required resolution");
-
- let imageURL = test.menuResolutions[resolution];
- is(getListStyleImage(browserActionButton), imageURL, `browser action has the correct menu image at ${resolution}x resolution`);
-
- await SpecialPowers.popPrefEnv();
- }
-
- await closeBrowserAction(extension);
-
- CustomizableUI.addWidgetToArea(browserActionWidget.id,
- CustomizableUI.AREA_NAVBAR);
- }
}
await extension.unload();
});
--- a/browser/components/extensions/test/browser/browser_ext_browserAction_popup_resize.js
+++ b/browser/components/extensions/test/browser/browser_ext_browserAction_popup_resize.js
@@ -153,17 +153,17 @@ async function testPopupSize(standardsMo
// Test the PanelUI panel for a menu panel button.
let widget = getBrowserActionWidget(extension);
CustomizableUI.addWidgetToArea(widget.id, getCustomizableUIPanelID());
let browser = await openPanel(extension, browserWin);
- let panel = gPhotonStructure ? browserWin.PanelUI.overflowPanel : browserWin.PanelUI.panel;
+ let panel = browserWin.PanelUI.overflowPanel;
let origPanelRect = panel.getBoundingClientRect();
// Check that the panel is still positioned as expected.
let checkPanelPosition = () => {
is(panel.getAttribute("side"), arrowSide, "Panel arrow is positioned as expected");
let panelRect = panel.getBoundingClientRect();
if (arrowSide == "top") {
--- a/browser/components/extensions/test/browser/browser_ext_popup_corners.js
+++ b/browser/components/extensions/test/browser/browser_ext_popup_corners.js
@@ -1,15 +1,13 @@
/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set sts=2 sw=2 et tw=80: */
"use strict";
add_task(async function testPopupBorderRadius() {
- await SpecialPowers.pushPrefEnv({set: [["browser.photon.structure.enabled", false]]});
-
let extension = ExtensionTestUtils.loadExtension({
background() {
browser.tabs.query({active: true, currentWindow: true}, tabs => {
browser.pageAction.show(tabs[0].id);
});
},
manifest: {
--- a/browser/components/extensions/test/browser/browser_ext_themes_icons.js
+++ b/browser/components/extensions/test/browser/browser_ext_themes_icons.js
@@ -165,30 +165,16 @@ async function runTestWithIcons(icons) {
}
let extension = ExtensionTestUtils.loadExtension({manifest, files});
await extension.startup();
checkButtons(icons, ICON_INFO, "toolbar");
- if (!gPhotonStructure) {
- for (let button of ICON_INFO) {
- if (button[2]) {
- CustomizableUI.addWidgetToArea(button[2], CustomizableUI.AREA_PANEL);
- }
- }
-
- await PanelUI.show();
-
- checkButtons(icons, ICON_INFO, "panel");
-
- await PanelUI.hide();
- }
-
await extension.unload();
for (let button of ICON_INFO) {
verifyButtonWithoutCustomStyling(button[1],
`The ${button[1]} should not have its icon customized when the theme is unloaded`);
}
}
--- a/browser/components/extensions/test/browser/head.js
+++ b/browser/components/extensions/test/browser/head.js
@@ -209,48 +209,40 @@ var awaitExtensionPanel = async function
awaitLoad && awaitBrowserLoaded(browser),
]);
return browser;
};
function getCustomizableUIPanelID() {
- return gPhotonStructure ? CustomizableUI.AREA_FIXED_OVERFLOW_PANEL
- : CustomizableUI.AREA_PANEL;
+ return CustomizableUI.AREA_FIXED_OVERFLOW_PANEL;
}
function getBrowserActionWidget(extension) {
return CustomizableUI.getWidget(makeWidgetId(extension.id) + "-browser-action");
}
function getBrowserActionPopup(extension, win = window) {
let group = getBrowserActionWidget(extension);
if (group.areaType == CustomizableUI.TYPE_TOOLBAR) {
return win.document.getElementById("customizationui-widget-panel");
}
- return gPhotonStructure ? win.PanelUI.overflowPanel : win.PanelUI.panel;
+ return win.PanelUI.overflowPanel;
}
var showBrowserAction = async function(extension, win = window) {
let group = getBrowserActionWidget(extension);
let widget = group.forWindow(win);
if (group.areaType == CustomizableUI.TYPE_TOOLBAR) {
ok(!widget.overflowed, "Expect widget not to be overflowed");
} else if (group.areaType == CustomizableUI.TYPE_MENU_PANEL) {
- // Show the right panel. After Photon is turned on permanently, this
- // can be re-simplified. This is unfortunately easier than getting
- // and using the panel (area) ID out of CustomizableUI for the widget.
- if (gPhotonStructure) {
- await win.document.getElementById("nav-bar").overflowable.show();
- } else {
- await win.PanelUI.show();
- }
+ await win.document.getElementById("nav-bar").overflowable.show();
}
};
var clickBrowserAction = async function(extension, win = window) {
await promiseAnimationFrame(win);
await showBrowserAction(extension, win);
let widget = getBrowserActionWidget(extension).forWindow(win);
--- a/browser/themes/shared/customizableui/panelUI.inc.css
+++ b/browser/themes/shared/customizableui/panelUI.inc.css
@@ -333,17 +333,16 @@ panelview:not([mainview]) .toolbarbutton
padding: 4px 0;
}
/* START photonpanelview adjustments */
#appMenu-popup > .panel-arrowcontainer > .panel-arrowcontent,
panel[photon] > .panel-arrowcontainer > .panel-arrowcontent {
padding: 0;
- border-radius: 0;
}
photonpanelmultiview panelview {
background: var(--arrowpanel-background);
padding: 0;
}
#appMenu-popup panelview,