mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 729528 - Switch to using the requested display port resolution on the active tab. r=Cwiiis
This commit is contained in:
parent
11ef39eb64
commit
581562f648
@ -1607,7 +1607,8 @@ Tab.prototype = {
|
||||
|
||||
setDisplayPort: function(aViewportX, aViewportY, aDisplayPort) {
|
||||
let zoom = this._zoom;
|
||||
if (zoom <= 0)
|
||||
let resolution = aDisplayPort.resolution;
|
||||
if (zoom <= 0 || resolution <= 0)
|
||||
return;
|
||||
|
||||
let element = this.browser.contentDocument.documentElement;
|
||||
@ -1615,10 +1616,14 @@ Tab.prototype = {
|
||||
return;
|
||||
|
||||
let cwu = window.top.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
|
||||
cwu.setDisplayPortForElement((aDisplayPort.left - aViewportX) / zoom,
|
||||
(aDisplayPort.top - aViewportY) / zoom,
|
||||
(aDisplayPort.right - aDisplayPort.left) / zoom,
|
||||
(aDisplayPort.bottom - aDisplayPort.top) / zoom,
|
||||
if (BrowserApp.selectedTab == this)
|
||||
cwu.setResolution(resolution, resolution);
|
||||
else if (resolution != zoom)
|
||||
dump("Warning: setDisplayPort resolution did not match zoom for background tab!");
|
||||
cwu.setDisplayPortForElement((aDisplayPort.left - aViewportX) / resolution,
|
||||
(aDisplayPort.top - aViewportY) / resolution,
|
||||
(aDisplayPort.right - aDisplayPort.left) / resolution,
|
||||
(aDisplayPort.bottom - aDisplayPort.top) / resolution,
|
||||
element);
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user