Bug 887889 - Don't load browser zoom pref for blank page r?mak draft
authorDoug Thayer <dothayer@mozilla.com>
Thu, 22 Mar 2018 20:32:14 -0700
changeset 772060 6ba63582dca93952c1af6dc954336eebbf756d7a
parent 772059 890c332e09568425fa8a1aea3cd5c29a539d8d7f
push id103846
push userbmo:dothayer@mozilla.com
push dateSat, 24 Mar 2018 23:00:57 +0000
reviewersmak
bugs887889
milestone61.0a1
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
browser/base/content/browser-fullZoom.js
--- 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);