mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Remove CSS transforms as they're basically incompatible with displayports
This commit is contained in:
parent
ad35e17cb4
commit
0910dba276
@ -852,27 +852,20 @@ var BrowserApp = {
|
|||||||
top: focusedRect.top - tab.viewportExcess.y,
|
top: focusedRect.top - tab.viewportExcess.y,
|
||||||
bottom: focusedRect.bottom - tab.viewportExcess.y
|
bottom: focusedRect.bottom - tab.viewportExcess.y
|
||||||
};
|
};
|
||||||
let transformChanged = false;
|
|
||||||
if (focusedRect.right >= visibleContentWidth && focusedRect.left > 0) {
|
if (focusedRect.right >= visibleContentWidth && focusedRect.left > 0) {
|
||||||
// the element is too far off the right side, so we need to scroll to the right more
|
// the element is too far off the right side, so we need to scroll to the right more
|
||||||
tab.viewportExcess.x += Math.min(focusedRect.left, focusedRect.right - visibleContentWidth);
|
tab.viewportExcess.x += Math.min(focusedRect.left, focusedRect.right - visibleContentWidth);
|
||||||
transformChanged = true;
|
|
||||||
} else if (focusedRect.left < 0) {
|
} else if (focusedRect.left < 0) {
|
||||||
// the element is too far off the left side, so we need to scroll to the left more
|
// the element is too far off the left side, so we need to scroll to the left more
|
||||||
tab.viewportExcess.x += focusedRect.left;
|
tab.viewportExcess.x += focusedRect.left;
|
||||||
transformChanged = true;
|
|
||||||
}
|
}
|
||||||
if (focusedRect.bottom >= visibleContentHeight && focusedRect.top > 0) {
|
if (focusedRect.bottom >= visibleContentHeight && focusedRect.top > 0) {
|
||||||
// the element is too far down, so we need to scroll down more
|
// the element is too far down, so we need to scroll down more
|
||||||
tab.viewportExcess.y += Math.min(focusedRect.top, focusedRect.bottom - visibleContentHeight);
|
tab.viewportExcess.y += Math.min(focusedRect.top, focusedRect.bottom - visibleContentHeight);
|
||||||
transformChanged = true;
|
|
||||||
} else if (focusedRect.top < 0) {
|
} else if (focusedRect.top < 0) {
|
||||||
// the element is too far up, so we need to scroll up more
|
// the element is too far up, so we need to scroll up more
|
||||||
tab.viewportExcess.y += focusedRect.top;
|
tab.viewportExcess.y += focusedRect.top;
|
||||||
transformChanged = true;
|
|
||||||
}
|
}
|
||||||
if (transformChanged)
|
|
||||||
tab.updateTransform();
|
|
||||||
// finally, let java know where we ended up
|
// finally, let java know where we ended up
|
||||||
tab.sendViewportUpdate();
|
tab.sendViewportUpdate();
|
||||||
}
|
}
|
||||||
@ -1431,7 +1424,6 @@ Tab.prototype = {
|
|||||||
this.setBrowserSize(980, 480);
|
this.setBrowserSize(980, 480);
|
||||||
this.browser.style.width = gScreenWidth + "px";
|
this.browser.style.width = gScreenWidth + "px";
|
||||||
this.browser.style.height = gScreenHeight + "px";
|
this.browser.style.height = gScreenHeight + "px";
|
||||||
this.browser.style.MozTransformOrigin = "0 0";
|
|
||||||
this.vbox.appendChild(this.browser);
|
this.vbox.appendChild(this.browser);
|
||||||
|
|
||||||
this.browser.stop();
|
this.browser.stop();
|
||||||
@ -1566,27 +1558,19 @@ Tab.prototype = {
|
|||||||
this._viewport.height = gScreenHeight = aViewport.height;
|
this._viewport.height = gScreenHeight = aViewport.height;
|
||||||
dump("### gScreenWidth = " + gScreenWidth + "\n");
|
dump("### gScreenWidth = " + gScreenWidth + "\n");
|
||||||
|
|
||||||
let transformChanged = false;
|
|
||||||
|
|
||||||
if ((aViewport.offsetX != this._viewport.offsetX) ||
|
if ((aViewport.offsetX != this._viewport.offsetX) ||
|
||||||
(excessX != this.viewportExcess.x)) {
|
(excessX != this.viewportExcess.x)) {
|
||||||
this._viewport.offsetX = aViewport.offsetX;
|
this._viewport.offsetX = aViewport.offsetX;
|
||||||
this.viewportExcess.x = excessX;
|
this.viewportExcess.x = excessX;
|
||||||
transformChanged = true;
|
|
||||||
}
|
}
|
||||||
if ((aViewport.offsetY != this._viewport.offsetY) ||
|
if ((aViewport.offsetY != this._viewport.offsetY) ||
|
||||||
(excessY != this.viewportExcess.y)) {
|
(excessY != this.viewportExcess.y)) {
|
||||||
this._viewport.offsetY = aViewport.offsetY;
|
this._viewport.offsetY = aViewport.offsetY;
|
||||||
this.viewportExcess.y = excessY;
|
this.viewportExcess.y = excessY;
|
||||||
transformChanged = true;
|
|
||||||
}
|
}
|
||||||
if (Math.abs(aViewport.zoom - this._viewport.zoom) >= 1e-6) {
|
if (Math.abs(aViewport.zoom - this._viewport.zoom) >= 1e-6) {
|
||||||
this._viewport.zoom = aViewport.zoom;
|
this._viewport.zoom = aViewport.zoom;
|
||||||
transformChanged = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (transformChanged)
|
|
||||||
this.updateTransform();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
screenshot: function(aSrc, aDst) {
|
screenshot: function(aSrc, aDst) {
|
||||||
@ -1617,20 +1601,6 @@ Tab.prototype = {
|
|||||||
}, Ci.nsIThread.DISPATCH_NORMAL);
|
}, Ci.nsIThread.DISPATCH_NORMAL);
|
||||||
},
|
},
|
||||||
|
|
||||||
updateTransform: function() {
|
|
||||||
let hasZoom = (Math.abs(this._viewport.zoom - 1.0) >= 1e-6);
|
|
||||||
let x = this._viewport.offsetX + Math.round(-this.viewportExcess.x * this._viewport.zoom);
|
|
||||||
let y = this._viewport.offsetY + Math.round(-this.viewportExcess.y * this._viewport.zoom);
|
|
||||||
|
|
||||||
let transform =
|
|
||||||
"translate(" + x + "px, " +
|
|
||||||
y + "px)";
|
|
||||||
|
|
||||||
// FIXME: Use nsIDOMWindowUtils::SetResolution(this._viewport.zoom * k) for some k here.
|
|
||||||
|
|
||||||
this.browser.style.MozTransform = transform;
|
|
||||||
},
|
|
||||||
|
|
||||||
get viewport() {
|
get viewport() {
|
||||||
// Update the viewport to current dimensions
|
// Update the viewport to current dimensions
|
||||||
this._viewport.x = (this.browser.contentWindow.scrollX +
|
this._viewport.x = (this.browser.contentWindow.scrollX +
|
||||||
|
Loading…
Reference in New Issue
Block a user