зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1546832 - Adjust letterboxing to take the FindBar and Devtools into account r=johannh
Differential Revision: https://phabricator.services.mozilla.com/D31639 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
13e131d652
Коммит
e06d958abe
|
@ -19,4 +19,9 @@ class RFPHelperChild extends ActorChild {
|
|||
this.mm.sendAsyncMessage("Letterboxing:ContentSizeUpdated");
|
||||
}
|
||||
}
|
||||
receiveMessage(aMessage) {
|
||||
if (isLetterboxingEnabled) {
|
||||
this.mm.sendAsyncMessage("Letterboxing:ContentSizeUpdated");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -276,6 +276,10 @@ let LEGACY_ACTORS = {
|
|||
events: {
|
||||
"resize": {},
|
||||
},
|
||||
messages: [
|
||||
"Finder:FindbarOpen",
|
||||
"Finder:FindbarClose",
|
||||
],
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
@ -370,11 +370,20 @@ class _RFPHelper {
|
|||
let containerWidth = browserContainer.clientWidth;
|
||||
let containerHeight = browserContainer.clientHeight;
|
||||
|
||||
// If the findbar or devtools are out, we need to subtract their height (plus 1
|
||||
// for the separator) from the container height, because we need to adjust our
|
||||
// letterboxing to acount for it; however it is not included in that dimension
|
||||
// (but rather is subtracted from the content height.)
|
||||
let findBar = browserContainer.getElementsByClassName("findbar-container");
|
||||
let findBarOffset = findBar.length ? findBar[0].clientHeight + 1 : 0;
|
||||
let devtools = browserContainer.getElementsByClassName("devtools-toolbox-bottom-iframe");
|
||||
let devtoolsOffset = devtools.length ? devtools[0].clientHeight + 1 : 0;
|
||||
|
||||
return {
|
||||
contentWidth,
|
||||
contentHeight,
|
||||
containerWidth,
|
||||
containerHeight,
|
||||
containerHeight: containerHeight - findBarOffset - devtoolsOffset,
|
||||
};
|
||||
});
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче