mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 898877 - Ensure that viewport resizing behaviour due to dynamic toolbar is consistent. r=Cwiiis
In browser.js were two pieces of code that determined whether or not the CSS viewport size should include the margins. These two pieces of code were inconsistent in that one used rounding while the other used a fuzz. Also, one of them subtracted gViewportMargins from gScreenHeight while the other added them. This patch makes the two pieces of code consistent, and updates them to use a fuzz so that the CSS viewport is enlarged only when dealing with pages that are equal to or larger than the screen (with the toolbar hidden).
This commit is contained in:
parent
43fc0208a0
commit
0f50be37c3
@ -3276,15 +3276,13 @@ Tab.prototype = {
|
||||
let remeasureNeeded = false;
|
||||
|
||||
if (hasHorizontalMargins) {
|
||||
let screenWidth = gScreenWidth + gViewportMargins.left + gViewportMargins.right;
|
||||
let viewportShouldExcludeHorizontalMargins = (Math.round(pageWidth) <= screenWidth);
|
||||
let viewportShouldExcludeHorizontalMargins = (pageWidth <= gScreenWidth - 0.5);
|
||||
if (viewportShouldExcludeHorizontalMargins != this.viewportExcludesHorizontalMargins) {
|
||||
remeasureNeeded = true;
|
||||
}
|
||||
}
|
||||
if (hasVerticalMargins) {
|
||||
let screenHeight = gScreenHeight + gViewportMargins.top + gViewportMargins.bottom;
|
||||
let viewportShouldExcludeVerticalMargins = (Math.round(pageHeight) <= screenHeight);
|
||||
let viewportShouldExcludeVerticalMargins = (pageHeight <= gScreenHeight - 0.5);
|
||||
if (viewportShouldExcludeVerticalMargins != this.viewportExcludesVerticalMargins) {
|
||||
remeasureNeeded = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user