зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1044597 - Limit the minimum size of subdialogs in the in-content preferences. r=Gijs
--HG-- extra : rebase_source : dea2def9ce68d71531521d345d4bea7c046ea498
This commit is contained in:
Родитель
1ed997faaf
Коммит
b5c53cd373
|
@ -92,6 +92,8 @@ let gSubDialog = {
|
|||
// Clear the sizing attributes
|
||||
this._box.removeAttribute("width");
|
||||
this._box.removeAttribute("height");
|
||||
this._box.style.removeProperty("min-height");
|
||||
this._box.style.removeProperty("min-width");
|
||||
|
||||
setTimeout(() => {
|
||||
// Unload the dialog after the event listeners run so that the load of about:blank isn't
|
||||
|
@ -146,10 +148,17 @@ let gSubDialog = {
|
|||
|
||||
// padding-bottom doesn't seem to be included in the scrollHeight of the document element in XUL
|
||||
// so add it ourselves.
|
||||
let paddingBottom = parseFloat(this._frame.contentWindow.getComputedStyle(docEl).paddingBottom);
|
||||
let frameVerticalPadding = 2 * parseFloat(this._frame.contentWindow.getComputedStyle(docEl).paddingTop);
|
||||
let frameHorizontalPadding = 2 * parseFloat(this._frame.contentWindow.getComputedStyle(docEl).paddingLeft);
|
||||
let frameWidth = parseFloat(docEl.style.width) || docEl.scrollWidth;
|
||||
let frameHeight = parseFloat(docEl.style.height) || (docEl.scrollHeight + frameVerticalPadding);
|
||||
let boxVerticalBorder = 2 * parseFloat(getComputedStyle(this._box).borderTopWidth);
|
||||
let boxHorizontalBorder = 2 * parseFloat(getComputedStyle(this._box).borderLeftWidth);
|
||||
|
||||
this._frame.style.width = docEl.style.width || docEl.scrollWidth + "px";
|
||||
this._frame.style.height = docEl.style.height || (docEl.scrollHeight + paddingBottom) + "px";
|
||||
this._frame.style.width = frameWidth + "px";
|
||||
this._frame.style.height = frameHeight + "px";
|
||||
this._box.style.minHeight = (boxVerticalBorder + this._box.clientHeight) + "px";
|
||||
this._box.style.minWidth = (boxHorizontalBorder + frameHorizontalPadding + this._box.clientWidth) + "px";
|
||||
|
||||
this._overlay.style.visibility = "visible";
|
||||
this._frame.focus();
|
||||
|
|
Загрузка…
Ссылка в новой задаче