зеркало из https://github.com/mozilla/gecko-dev.git
Bug 828345 - Maintain aspect ratio for clamping scrollport. r=kats
Make sure the clamping scroll-port maintains its aspect ratio on Android. This fixes fixed position elements appearing to jitter after zooming out beyond the page boundaries.
This commit is contained in:
Родитель
d88672c543
Коммит
c2b8898f87
|
@ -3116,8 +3116,13 @@ Tab.prototype = {
|
||||||
let viewportHeight = gScreenHeight / zoom;
|
let viewportHeight = gScreenHeight / zoom;
|
||||||
let [pageWidth, pageHeight] = this.getPageSize(this.browser.contentDocument,
|
let [pageWidth, pageHeight] = this.getPageSize(this.browser.contentDocument,
|
||||||
viewportWidth, viewportHeight);
|
viewportWidth, viewportHeight);
|
||||||
let scrollPortWidth = Math.min(viewportWidth, pageWidth);
|
|
||||||
let scrollPortHeight = Math.min(viewportHeight, pageHeight);
|
// Make sure the aspect ratio of the screen is maintained when setting
|
||||||
|
// the clamping scroll-port size.
|
||||||
|
let factor = Math.min(viewportWidth / gScreenWidth, pageWidth / gScreenWidth,
|
||||||
|
viewportHeight / gScreenHeight, pageHeight / gScreenHeight);
|
||||||
|
let scrollPortWidth = gScreenWidth * factor;
|
||||||
|
let scrollPortHeight = gScreenHeight * factor;
|
||||||
|
|
||||||
let win = this.browser.contentWindow;
|
let win = this.browser.contentWindow;
|
||||||
win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils).
|
win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils).
|
||||||
|
|
Загрузка…
Ссылка в новой задаче