зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 2 changesets (bug 1451058) for failing browser chrome at browser/components/extensions/test/browser/test-oop-extensions/browser_ext_browserAction_popup.js on a CLOSED TREE
Backed out changeset 7047a6811fdc (bug 1451058) Backed out changeset 29b2567d16eb (bug 1451058)
This commit is contained in:
Родитель
ca08ea41e6
Коммит
4098782378
|
@ -60,8 +60,6 @@ XPCOMUtils.defineLazyGetter(this, "standaloneStylesheets", () => {
|
|||
return stylesheets;
|
||||
});
|
||||
|
||||
const REMOTE_PANEL_ID = "webextension-remote-preload-panel";
|
||||
|
||||
class BasePopup {
|
||||
constructor(extension, viewNode, popupURL, browserStyle, fixedWidth = false, blockParser = false) {
|
||||
this.extension = extension;
|
||||
|
@ -124,7 +122,7 @@ class BasePopup {
|
|||
}
|
||||
|
||||
let {panel} = this;
|
||||
if (panel && panel.id !== REMOTE_PANEL_ID) {
|
||||
if (panel) {
|
||||
panel.style.removeProperty("--arrowpanel-background");
|
||||
panel.removeAttribute("remote");
|
||||
}
|
||||
|
@ -416,31 +414,15 @@ class ViewPopup extends BasePopup {
|
|||
constructor(extension, window, popupURL, browserStyle, fixedWidth, blockParser) {
|
||||
let document = window.document;
|
||||
|
||||
let createPanel = remote => {
|
||||
let panel = document.createElement("panel");
|
||||
panel.setAttribute("type", "arrow");
|
||||
if (remote) {
|
||||
panel.setAttribute("remote", "true");
|
||||
}
|
||||
|
||||
document.getElementById("mainPopupSet").appendChild(panel);
|
||||
return panel;
|
||||
};
|
||||
|
||||
// Create a temporary panel to hold the browser while it pre-loads its
|
||||
// content. This panel will never be shown, but the browser's docShell will
|
||||
// be swapped with the browser in the real panel when it's ready. For remote
|
||||
// extensions, this popup is shared between all extensions.
|
||||
let panel;
|
||||
// be swapped with the browser in the real panel when it's ready.
|
||||
let panel = document.createElement("panel");
|
||||
panel.setAttribute("type", "arrow");
|
||||
if (extension.remote) {
|
||||
panel = document.getElementById(REMOTE_PANEL_ID);
|
||||
if (!panel) {
|
||||
panel = createPanel(true);
|
||||
panel.id = REMOTE_PANEL_ID;
|
||||
}
|
||||
} else {
|
||||
panel = createPanel();
|
||||
panel.setAttribute("remote", "true");
|
||||
}
|
||||
document.getElementById("mainPopupSet").appendChild(panel);
|
||||
|
||||
super(extension, panel, popupURL, browserStyle, fixedWidth, blockParser);
|
||||
|
||||
|
@ -449,7 +431,6 @@ class ViewPopup extends BasePopup {
|
|||
this.attached = false;
|
||||
this.shown = false;
|
||||
this.tempPanel = panel;
|
||||
this.tempBrowser = this.browser;
|
||||
|
||||
this.browser.classList.add("webextension-preload-browser");
|
||||
}
|
||||
|
@ -542,7 +523,8 @@ class ViewPopup extends BasePopup {
|
|||
return {height: this.lastCalculatedInViewHeight || this.viewHeight};
|
||||
};
|
||||
|
||||
this.removeTempPanel();
|
||||
this.tempPanel.remove();
|
||||
this.tempPanel = null;
|
||||
|
||||
this.shown = true;
|
||||
|
||||
|
@ -561,24 +543,12 @@ class ViewPopup extends BasePopup {
|
|||
return true;
|
||||
}
|
||||
|
||||
removeTempPanel() {
|
||||
if (this.tempPanel) {
|
||||
if (this.tempPanel.id !== REMOTE_PANEL_ID) {
|
||||
this.tempPanel.remove();
|
||||
}
|
||||
this.tempPanel = null;
|
||||
}
|
||||
if (this.tempBrowser) {
|
||||
if (this.tempBrowser.parentNode) {
|
||||
this.tempBrowser.parentNode.remove();
|
||||
}
|
||||
this.tempBrowser = null;
|
||||
}
|
||||
}
|
||||
|
||||
destroy() {
|
||||
return super.destroy().then(() => {
|
||||
this.removeTempPanel();
|
||||
if (this.tempPanel) {
|
||||
this.tempPanel.remove();
|
||||
this.tempPanel = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче