зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1337325 - Remove unused zoom and scroll code from browser.js r=kats
More JPZ leftovers, I presume. In any case what's left doesn't do anything really useful and a DXR search didn't reveal any remaining users, so this can be thrown out. MozReview-Commit-ID: 9dN6Jifpbvw --HG-- extra : rebase_source : 04614d729a55e00c5331ecc321ca2ef5b5e73747
This commit is contained in:
Родитель
49df9f3c4f
Коммит
644356e330
|
@ -3430,10 +3430,6 @@ function Tab(aURL, aParams) {
|
||||||
this.id = 0;
|
this.id = 0;
|
||||||
this._parentId = -1;
|
this._parentId = -1;
|
||||||
this.lastTouchedAt = Date.now();
|
this.lastTouchedAt = Date.now();
|
||||||
this._zoom = 1.0;
|
|
||||||
this._drawZoom = 1.0;
|
|
||||||
this._restoreZoom = false;
|
|
||||||
this.userScrollPos = { x: 0, y: 0 };
|
|
||||||
this.contentDocumentIsDisplayed = true;
|
this.contentDocumentIsDisplayed = true;
|
||||||
this.pluginDoorhangerTimeout = null;
|
this.pluginDoorhangerTimeout = null;
|
||||||
this.shouldShowPluginDoorhanger = true;
|
this.shouldShowPluginDoorhanger = true;
|
||||||
|
@ -4509,47 +4505,17 @@ Tab.prototype = {
|
||||||
// notifications using nsBrowserStatusFilter.
|
// notifications using nsBrowserStatusFilter.
|
||||||
},
|
},
|
||||||
|
|
||||||
_getGeckoZoom: function() {
|
|
||||||
let res = {};
|
|
||||||
let cwu = this.browser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
|
|
||||||
cwu.getResolution(res);
|
|
||||||
let zoom = res.value * window.devicePixelRatio;
|
|
||||||
return zoom;
|
|
||||||
},
|
|
||||||
|
|
||||||
saveSessionZoom: function(aZoom) {
|
|
||||||
let cwu = this.browser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
|
|
||||||
cwu.setResolutionAndScaleTo(aZoom / window.devicePixelRatio);
|
|
||||||
},
|
|
||||||
|
|
||||||
restoredSessionZoom: function() {
|
|
||||||
let cwu = this.browser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
|
|
||||||
|
|
||||||
if (this._restoreZoom && cwu.isResolutionSet) {
|
|
||||||
return this._getGeckoZoom();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
|
|
||||||
_updateZoomFromHistoryEvent: function(aHistoryEventName) {
|
|
||||||
// Restore zoom only when moving in session history, not for new page loads.
|
|
||||||
this._restoreZoom = aHistoryEventName !== "New";
|
|
||||||
},
|
|
||||||
|
|
||||||
OnHistoryNewEntry: function(newURI, oldIndex) {
|
OnHistoryNewEntry: function(newURI, oldIndex) {
|
||||||
Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
|
Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
|
||||||
this._updateZoomFromHistoryEvent("New");
|
|
||||||
},
|
},
|
||||||
|
|
||||||
OnHistoryGoBack: function(backURI) {
|
OnHistoryGoBack: function(backURI) {
|
||||||
Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
|
Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
|
||||||
this._updateZoomFromHistoryEvent("Back");
|
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
OnHistoryGoForward: function(forwardURI) {
|
OnHistoryGoForward: function(forwardURI) {
|
||||||
Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
|
Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
|
||||||
this._updateZoomFromHistoryEvent("Forward");
|
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -4560,7 +4526,6 @@ Tab.prototype = {
|
||||||
|
|
||||||
OnHistoryGotoIndex: function(index, gotoURI) {
|
OnHistoryGotoIndex: function(index, gotoURI) {
|
||||||
Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
|
Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
|
||||||
this._updateZoomFromHistoryEvent("Goto");
|
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -4656,10 +4621,6 @@ Tab.prototype = {
|
||||||
return this.browser.contentWindow;
|
return this.browser.contentWindow;
|
||||||
},
|
},
|
||||||
|
|
||||||
get scale() {
|
|
||||||
return this._zoom;
|
|
||||||
},
|
|
||||||
|
|
||||||
QueryInterface: XPCOMUtils.generateQI([
|
QueryInterface: XPCOMUtils.generateQI([
|
||||||
Ci.nsIWebProgressListener,
|
Ci.nsIWebProgressListener,
|
||||||
Ci.nsISHistoryListener,
|
Ci.nsISHistoryListener,
|
||||||
|
|
|
@ -9,7 +9,6 @@ interface mozIDOMWindowProxy;
|
||||||
[scriptable, uuid(e8420a7b-659b-4325-968b-a114a6a067aa)]
|
[scriptable, uuid(e8420a7b-659b-4325-968b-a114a6a067aa)]
|
||||||
interface nsIBrowserTab : nsISupports {
|
interface nsIBrowserTab : nsISupports {
|
||||||
readonly attribute mozIDOMWindowProxy window;
|
readonly attribute mozIDOMWindowProxy window;
|
||||||
readonly attribute float scale;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
[scriptable, uuid(08426a73-e70b-4680-9282-630932e2b2bb)]
|
[scriptable, uuid(08426a73-e70b-4680-9282-630932e2b2bb)]
|
||||||
|
|
Загрузка…
Ссылка в новой задаче