Bug 887889 - Don't load browser zoom pref for blank page r?mak
This is breaking the browser_startup.js test, because it causes
us to load Sqlite.jsm before handling user input. It should be
fine to do this if we have about:blank with a null principal,
because that should just be a blank page with nothing to actually
zoom in or out of.
MozReview-Commit-ID: 8NowWqt3cgy
--- a/browser/base/content/browser-fullZoom.js
+++ b/browser/base/content/browser-fullZoom.js
@@ -206,18 +206,22 @@ var FullZoom = {
if (!aURI || (aIsTabSwitch && !this.siteSpecific)) {
this._notifyOnLocationChange(browser);
return;
}
// Avoid the cps roundtrip and apply the default/global pref.
if (aURI.spec == "about:blank") {
- this._applyPrefToZoom(undefined, browser,
- this._notifyOnLocationChange.bind(this, browser));
+ // If it's a null principal, it should be a blank page, so we don't need
+ // to do anything.
+ if (browser.contentPrincipal && !browser.contentPrincipal.isNullPrincipal) {
+ this._applyPrefToZoom(undefined, browser,
+ this._notifyOnLocationChange.bind(this, browser));
+ }
return;
}
// Media documents should always start at 1, and are not affected by prefs.
if (!aIsTabSwitch && browser.isSyntheticDocument) {
ZoomManager.setZoomForBrowser(browser, 1);
// _ignorePendingZoomAccesses already called above, so no need here.
this._notifyOnLocationChange(browser);