Bug 1499340 - Remove TabSelect event listener from _setupEventListeners. r=dao
authorOriol Brufau <oriol-bugzilla@hotmail.com>
Wed, 17 Oct 2018 08:49:49 +0000
changeset 497397 41a19ac5f495117bd9cfbb0dc7e8e3fbe6f17c13
parent 497396 3895062d9e1d37a494a32e035b09ffea13c4fa57
child 497398 86474265d1630457d800c782f6ec072af87cccd3
push id9996
push userarchaeopteryx@coole-files.de
push dateThu, 18 Oct 2018 18:37:15 +0000
treeherdermozilla-beta@8efe26839243 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs1499340
milestone64.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 1499340 - Remove TabSelect event listener from _setupEventListeners. r=dao Differential Revision: https://phabricator.services.mozilla.com/D8862
browser/base/content/tabbrowser.js
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.js
+++ b/browser/base/content/tabbrowser.js
@@ -989,16 +989,20 @@ window._gBrowser = {
           previousTab: oldTab,
         },
       });
       newTab.dispatchEvent(event);
 
       this._tabAttrModified(oldTab, ["selected"]);
       this._tabAttrModified(newTab, ["selected"]);
 
+      this._startMultiSelectChange();
+      this._multiSelectChangeSelected = true;
+      this.clearMultiSelectedTabs(true);
+
       if (oldBrowser != newBrowser &&
           oldBrowser.getInPermitUnload) {
         oldBrowser.getInPermitUnload(inPermitUnload => {
           if (!inPermitUnload) {
             return;
           }
           // Since the user is switching away from a tab that has
           // a beforeunload prompt active, we remove the prompt.
@@ -4676,21 +4680,16 @@ window._gBrowser = {
       let browser = event.originalTarget;
       let tab = this.getTabForBrowser(browser);
       if (!tab) {
         return;
       }
 
       Services.obs.notifyObservers(tab, "AudibleAutoplayMediaOccurred");
     });
-
-    this.ownerGlobal.addEventListener("TabSelect", (event) => {
-      this._startMultiSelectChange();
-      this._multiSelectChangeSelected = true;
-    }, {passive: true});
   },
 };
 
 /**
  * A web progress listener object definition for a given tab.
  */
 class TabProgressListener {
   constructor(aTab, aBrowser, aStartsBlank, aWasPreloadedBrowser, aOrigStateFlags) {
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -1184,17 +1184,16 @@
           }
         ]]></body>
       </method>
     </implementation>
 
     <handlers>
       <handler event="TabSelect"><![CDATA[
         this._handleTabSelect();
-        gBrowser.clearMultiSelectedTabs(true);
       ]]></handler>
 
       <handler event="TabClose"><![CDATA[
         this._hiddenSoundPlayingStatusChanged(event.target, {closed: true});
       ]]></handler>
 
       <handler event="TabAttrModified"><![CDATA[
         if (event.detail.changed.includes("soundplaying") && event.target.hidden) {