mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 707132 - Adjust viewport used for meta-viewport calculations [r=mbrubeck]
Calculate the viewport size based on the user-visible content area and the zoom factor, rather than relying on the screen size, since the screen size doesn't take into account things like the URL bar and android chrome that may be visible.
This commit is contained in:
parent
244be6ba02
commit
446c9f4861
@ -1293,8 +1293,8 @@ Tab.prototype = {
|
||||
if (!browser)
|
||||
return;
|
||||
|
||||
let screenW = screen.width;
|
||||
let screenH = screen.height;
|
||||
let screenW = this._viewport.width;
|
||||
let screenH = this._viewport.height;
|
||||
let viewportW, viewportH;
|
||||
|
||||
let metadata = this.metadata;
|
||||
@ -1347,7 +1347,7 @@ Tab.prototype = {
|
||||
if (!this.browser.contentDocument || !this.browser.contentDocument.body)
|
||||
return 1.0;
|
||||
|
||||
return screen.width / this.browser.contentDocument.body.clientWidth;
|
||||
return this._viewport.width / this.browser.contentDocument.body.clientWidth;
|
||||
},
|
||||
|
||||
setBrowserSize: function(aWidth, aHeight) {
|
||||
|
Loading…
Reference in New Issue
Block a user