зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1519407 - Don't use promiseDocumentFlushed inside a frame that can be reparented. r=gl
Instead of using promiseDocumentFlushed, we optimistically use getBoundsWithoutFlushing to get a recent width for the inspector-splitter-box without flushing, which is probably sufficient to determine whether or not to enter landscape mode. Differential Revision: https://phabricator.services.mozilla.com/D16347 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
3cb1b02e77
Коммит
a1103de90c
|
@ -526,12 +526,14 @@ Inspector.prototype = {
|
|||
return true;
|
||||
}
|
||||
|
||||
const { clientWidth } = this.panelDoc.getElementById("inspector-splitter-box");
|
||||
const splitterBox = this.panelDoc.getElementById("inspector-splitter-box");
|
||||
const { width } = window.windowUtils.getBoundsWithoutFlushing(splitterBox);
|
||||
|
||||
return this.is3PaneModeEnabled &&
|
||||
(this.toolbox.hostType == Toolbox.HostType.LEFT ||
|
||||
this.toolbox.hostType == Toolbox.HostType.RIGHT) ?
|
||||
clientWidth > SIDE_PORTAIT_MODE_WIDTH_THRESHOLD :
|
||||
clientWidth > PORTRAIT_MODE_WIDTH_THRESHOLD;
|
||||
width > SIDE_PORTAIT_MODE_WIDTH_THRESHOLD :
|
||||
width > PORTRAIT_MODE_WIDTH_THRESHOLD;
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -584,17 +586,7 @@ Inspector.prototype = {
|
|||
return;
|
||||
}
|
||||
|
||||
// Use window.top because promiseDocumentFlushed() in a subframe doesn't
|
||||
// work, see https://bugzilla.mozilla.org/show_bug.cgi?id=1441173
|
||||
const useLandscapeMode = await window.top.promiseDocumentFlushed(() => {
|
||||
return this.useLandscapeMode();
|
||||
});
|
||||
|
||||
if (window.closed) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.splitBox.setState({ vert: useLandscapeMode });
|
||||
this.splitBox.setState({ vert: this.useLandscapeMode() });
|
||||
this.emit("inspector-resize");
|
||||
},
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче