Bug 1354532 - Part 3 - Ensure that the offscreen bounds check for panelviews does not cause temporary empty panels. r=Paolo

MozReview-Commit-ID: 8EACBXDekIW

--HG--
extra : rebase_source : d53f3461db931733a7d1e7722d0fa23ad659fa06
This commit is contained in:
Mike de Boer 2017-09-06 17:21:24 +02:00
Родитель d9febd9d56
Коммит df2fab0b05
1 изменённых файлов: 6 добавлений и 4 удалений

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

@ -11,6 +11,8 @@ const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
"resource://gre/modules/AppConstants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
"resource://gre/modules/BrowserUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI",
"resource:///modules/CustomizableUI.jsm");
@ -733,9 +735,9 @@ this.PanelMultiView = class {
let oldSibling = viewNode.nextSibling || null;
this._offscreenViewStack.appendChild(viewNode);
this.window.addEventListener("MozAfterPaint", () => {
let viewRect = this._dwu.getBoundsWithoutFlushing(viewNode);
BrowserUtils.promiseLayoutFlushed(this.document, "layout", () => {
return this._dwu.getBoundsWithoutFlushing(viewNode);
}).then(viewRect => {
try {
this._viewStack.insertBefore(viewNode, oldSibling);
} catch (ex) {
@ -743,7 +745,7 @@ this.PanelMultiView = class {
}
callback(viewRect);
}, { once: true });
});
}
/**