mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Bug 726817 - Use nsIFrameLoaderOwner.clampScrollPosition to fix clip on zoom.
Zooming in caused the right and bottom edges of the page to be clipped. This was because we would try to scroll to coordinates that, untransformed, would be invalid. The document has no knowledge of the zoom, and so the scroll position needs to be forced somehow. Java compositor accomplished this using a CSS translation transformation, this accomplishes it by turning off scroll position clamping (a technique that the Java compositor should also employ, if the patch this relies on passes review).
This commit is contained in:
parent
a737e6fe48
commit
c84e375054
@ -1476,6 +1476,7 @@ Tab.prototype = {
|
||||
let frameLoader = this.browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
|
||||
if (kUsingGLLayers) {
|
||||
frameLoader.renderMode = Ci.nsIFrameLoader.RENDER_MODE_ASYNC_SCROLL;
|
||||
frameLoader.clampScrollPosition = false;
|
||||
} else {
|
||||
// Turn off clipping so we can buffer areas outside of the browser element.
|
||||
frameLoader.clipSubdocument = false;
|
||||
@ -1593,11 +1594,6 @@ Tab.prototype = {
|
||||
this.userScrollPos.x = win.scrollX;
|
||||
this.userScrollPos.y = win.scrollY;
|
||||
|
||||
// If we've been asked to over-scroll, do it via the transformation
|
||||
// and store it separately to the viewport.
|
||||
let excessX = aViewport.x - win.scrollX;
|
||||
let excessY = aViewport.y - win.scrollY;
|
||||
|
||||
this._viewport.width = gScreenWidth = aViewport.width;
|
||||
this._viewport.height = gScreenHeight = aViewport.height;
|
||||
dump("### gScreenWidth = " + gScreenWidth + "\n");
|
||||
@ -1606,15 +1602,11 @@ Tab.prototype = {
|
||||
let cwu = window.top.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindowUtils);
|
||||
|
||||
if ((aViewport.offsetX != this._viewport.offsetX) ||
|
||||
(excessX != this.viewportExcess.x)) {
|
||||
if (aViewport.offsetX != this._viewport.offsetX) {
|
||||
this._viewport.offsetX = aViewport.offsetX;
|
||||
this.viewportExcess.x = excessX;
|
||||
}
|
||||
if ((aViewport.offsetY != this._viewport.offsetY) ||
|
||||
(excessY != this.viewportExcess.y)) {
|
||||
if (aViewport.offsetY != this._viewport.offsetY) {
|
||||
this._viewport.offsetY = aViewport.offsetY;
|
||||
this.viewportExcess.y = excessY;
|
||||
}
|
||||
if (Math.abs(zoom - this._viewport.zoom) >= 1e-6) {
|
||||
this._viewport.zoom = zoom;
|
||||
|
Loading…
Reference in New Issue
Block a user