Bug 1403965 fix context menu position in extension sidebar, r=kmag

MozReview-Commit-ID: 37XgWflt2qG

--HG--
extra : rebase_source : 224eb8ad1f1f12b1598cbad48536fab51e26648d
This commit is contained in:
Shane Caraveo 2018-04-24 13:01:00 -05:00
parent a07765b336
commit be53524747
2 changed files with 16 additions and 0 deletions

View File

@ -189,6 +189,11 @@ var SidebarUI = {
}
this.hideSwitcherPanel();
let content = SidebarUI.browser.contentWindow;
if (content && content.updatePosition) {
content.updatePosition();
}
},
/**

View File

@ -93,6 +93,17 @@ var gBrowser = {
},
};
function updatePosition() {
// We need both of these to make sure we update the position
// after any lower level updates have finished.
requestAnimationFrame(() => setTimeout(() => {
let browser = document.getElementById("webext-panels-browser");
if (browser && browser.isRemoteBrowser) {
browser.frameLoader.requestUpdatePosition();
}
}, 0));
}
function loadPanel(extensionId, extensionUrl, browserStyle) {
let browserEl = document.getElementById("webext-panels-browser");
if (browserEl) {