mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
Bug 741988 - Avoid potentially triggering an extra draw. r=Cwiiis
This commit is contained in:
parent
53b68f300e
commit
7d9f0ae32b
@ -1470,6 +1470,7 @@ function Tab(aURL, aParams) {
|
||||
this.showProgress = true;
|
||||
this.create(aURL, aParams);
|
||||
this._zoom = 1.0;
|
||||
this._drawZoom = 1.0;
|
||||
this.userScrollPos = { x: 0, y: 0 };
|
||||
this.contentDocumentIsDisplayed = true;
|
||||
this.clickToPlayPluginDoorhangerShown = false;
|
||||
@ -1637,10 +1638,14 @@ Tab.prototype = {
|
||||
// visible zoom. for foreground tabs, however, if we are drawing at some other
|
||||
// resolution, we need to set the resolution as specified.
|
||||
let cwu = window.top.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
|
||||
if (BrowserApp.selectedTab == this)
|
||||
cwu.setResolution(resolution, resolution);
|
||||
else if (resolution != zoom)
|
||||
if (BrowserApp.selectedTab == this) {
|
||||
if (resolution != this._drawZoom) {
|
||||
this._drawZoom = resolution;
|
||||
cwu.setResolution(resolution, resolution);
|
||||
}
|
||||
} else if (resolution != zoom) {
|
||||
dump("Warning: setDisplayPort resolution did not match zoom for background tab!");
|
||||
}
|
||||
|
||||
// finally, we set the display port, taking care to convert everything into the CSS-pixel
|
||||
// coordinate space, because that is what the function accepts.
|
||||
@ -1671,6 +1676,7 @@ Tab.prototype = {
|
||||
this._zoom = aZoom;
|
||||
if (BrowserApp.selectedTab == this) {
|
||||
let cwu = window.top.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
|
||||
this._drawZoom = aZoom;
|
||||
cwu.setResolution(aZoom, aZoom);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user