Bug 1508171 - Remove gBrowser.initialBrowser. r=Gijs
authorDão Gottwald <dao@mozilla.com>
Wed, 19 Feb 2020 15:49:19 +0000
changeset 514620 9e4eb113462e64c77b554b364dedf668f2af003f
parent 514619 b6bfd21e32a81f9806f1c25e77ff4e23f8a7064e
child 514621 e4b569cb147e7c004e94fb78038b111c2908989a
push id37139
push userccoroiu@mozilla.com
push dateWed, 19 Feb 2020 21:50:02 +0000
treeherdermozilla-central@5bfe22b4bd0d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1508171
milestone75.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1508171 - Remove gBrowser.initialBrowser. r=Gijs Differential Revision: https://phabricator.services.mozilla.com/D63332
browser/base/content/browser.js
browser/base/content/tabbrowser.js
testing/talos/talos/pageloader/chrome/pageloader.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -5171,17 +5171,17 @@ var XULBrowserWindow = {
     delete this._elementsForViewSource;
     return (this._elementsForViewSource = [
       document.getElementById("context-viewsource"),
       document.getElementById("View:PageSource"),
     ]);
   },
 
   forceInitialBrowserNonRemote(aOpener) {
-    gBrowser.updateBrowserRemoteness(gBrowser.initialBrowser, {
+    gBrowser.updateBrowserRemoteness(gBrowser.selectedBrowser, {
       opener: aOpener,
       remoteType: E10SUtils.NOT_REMOTE,
     });
   },
 
   setDefaultStatus(status) {
     this.defaultStatus = status;
     StatusPanel.update();
--- a/browser/base/content/tabbrowser.js
+++ b/browser/base/content/tabbrowser.js
@@ -409,20 +409,16 @@
       this._tabForBrowser.set(browser, tab);
 
       this._appendStatusPanel();
 
       // This is the initial browser, so it's usually active; the default is false
       // so we have to update it:
       browser.docShellIsActive = this.shouldActivateDocShell(browser);
 
-      // Only necessary because of pageloader talos tests which access this.
-      // Bug 1508171 covers removing this.
-      this.initialBrowser = browser;
-
       let autoScrollPopup = browser._createAutoScrollPopup();
       autoScrollPopup.id = "autoscroller";
       document.getElementById("mainPopupSet").appendChild(autoScrollPopup);
       browser.setAttribute("autoscrollpopup", autoScrollPopup.id);
       this._autoScrollPopup = autoScrollPopup;
 
       // Hook the browser up with a progress listener.
       let tabListener = new TabProgressListener(tab, browser, true, false);
--- a/testing/talos/talos/pageloader/chrome/pageloader.js
+++ b/testing/talos/talos/pageloader/chrome/pageloader.js
@@ -231,21 +231,21 @@ function plInit() {
         // to this reinitialization on the switch.
         let remoteType = E10SUtils.getRemoteTypeForURI(
           pageUrls[0],
           /* remote */ true,
           /* fission */ Services.prefs.getBoolPref("fission.autostart")
         );
         let tabbrowser = browserWindow.gBrowser;
         if (remoteType) {
-          tabbrowser.updateBrowserRemoteness(tabbrowser.initialBrowser, {
+          tabbrowser.updateBrowserRemoteness(tabbrowser.selectedBrowser, {
             remoteType,
           });
         } else {
-          tabbrowser.updateBrowserRemoteness(tabbrowser.initialBrowser, {
+          tabbrowser.updateBrowserRemoteness(tabbrowser.selectedBrowser, {
             remoteType: E10SUtils.NOT_REMOTE,
           });
         }
 
         browserWindow.resizeTo(winWidth, winHeight);
         browserWindow.moveTo(0, 0);
         browserWindow.focus();
         content = browserWindow.gBrowser;