зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 160daad53292 (bug 1710462) for causing browser chrome failures on browser_subdialogs.js. CLOSED TREE
This commit is contained in:
Родитель
17997fac31
Коммит
b9cf731dc4
|
@ -362,19 +362,13 @@ SubDialog.prototype = {
|
|||
let oldResizeBy = this._frame.contentWindow.resizeBy;
|
||||
this._frame.contentWindow.resizeBy = (resizeByWidth, resizeByHeight) => {
|
||||
// Only handle resizeByHeight currently.
|
||||
let frameHeight = this._overlay.parentNode.style.getPropertyValue(
|
||||
"--inner-height"
|
||||
);
|
||||
if (frameHeight) {
|
||||
frameHeight = parseFloat(frameHeight, 10);
|
||||
} else {
|
||||
frameHeight = this._frame.clientHeight;
|
||||
}
|
||||
let frameHeight = this._frame.clientHeight;
|
||||
let boxMinHeight = parseFloat(
|
||||
this._window.getComputedStyle(this._box).minHeight,
|
||||
10
|
||||
);
|
||||
|
||||
this._frame.style.height = frameHeight + resizeByHeight + "px";
|
||||
this._box.style.minHeight = boxMinHeight + resizeByHeight + "px";
|
||||
|
||||
this._overlay.parentNode.style.setProperty(
|
||||
|
@ -565,8 +559,10 @@ SubDialog.prototype = {
|
|||
|
||||
// Now check if the frame height we calculated is possible at this window size,
|
||||
// accounting for titlebar, padding/border and some spacing.
|
||||
let frameOverhead = frameSizeDifference + (this._titleBar ? 30 : 0);
|
||||
let maxHeight = this._window.innerHeight - frameOverhead;
|
||||
let maxHeight =
|
||||
this._window.innerHeight -
|
||||
frameSizeDifference -
|
||||
(this._titleBar ? 30 : 0);
|
||||
// Do this with a frame height in pixels...
|
||||
let comparisonFrameHeight;
|
||||
if (frameHeight.endsWith("em")) {
|
||||
|
@ -595,6 +591,7 @@ SubDialog.prototype = {
|
|||
// contents scroll. The class is set on the "dialog" element, unless a
|
||||
// content pane exists, which is usually the case when the "window"
|
||||
// element is used to implement the subdialog instead.
|
||||
frameHeight = maxHeight + "px";
|
||||
frameMinHeight = maxHeight + "px";
|
||||
|
||||
if (contentPane) {
|
||||
|
@ -606,15 +603,14 @@ SubDialog.prototype = {
|
|||
}
|
||||
}
|
||||
|
||||
this._frame.style.height = frameHeight;
|
||||
this._overlay.parentNode.style.setProperty("--inner-height", frameHeight);
|
||||
this._frame.style.height = `min(
|
||||
calc(100vh - ${frameOverhead}px),
|
||||
var(--inner-height, ${frameHeight})
|
||||
)`;
|
||||
this._box.style.minHeight = `calc(
|
||||
${boxVerticalBorder + titleBarHeight + frameVerticalMargin}px +
|
||||
${frameMinHeight}
|
||||
)`;
|
||||
this._box.style.minHeight =
|
||||
"calc(" +
|
||||
(boxVerticalBorder + titleBarHeight + frameVerticalMargin) +
|
||||
"px + " +
|
||||
frameMinHeight +
|
||||
")";
|
||||
},
|
||||
|
||||
_onResize(mutations) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче