Bug 1514613 - Use originalTarget instead of relying on _overPlayingIcon where possible. r=dao
authorJared Wein <jwein@mozilla.com>
Tue, 08 Jan 2019 13:50:45 +0000
changeset 510018 e1faf5fa77a67493a392649b3e4158570331f652
parent 510017 507fae6b3eb45429cbd3ea034d1d0477b63b39ca
child 510019 e79251fa381cfc9f3425f6a746ac8d8c22046d6b
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs1514613
milestone66.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 1514613 - Use originalTarget instead of relying on _overPlayingIcon where possible. r=dao Differential Revision: https://phabricator.services.mozilla.com/D14778
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -2358,17 +2358,19 @@
         if (tabContainer._closeTabByDblclick &&
             event.button == 0 &&
             event.detail == 1) {
           this._selectedOnFirstMouseDown = this.selected;
         }
 
         if (this.selected) {
           this.style.MozUserFocus = "ignore";
-        } else if (this.mOverCloseButton || this._overPlayingIcon) {
+        } else if (event.originalTarget.classList.contains("tab-close-button") ||
+                   event.originalTarget.classList.contains("tab-icon-sound") ||
+                   event.originalTarget.classList.contains("tab-icon-overlay")) {
             // Prevent tabbox.xml from selecting the tab.
             event.stopPropagation();
         }
 
         if (event.button == 1) {
           gBrowser.warmupTab(gBrowser._findTabToBlurTo(this));
         }
 
@@ -2413,29 +2415,33 @@
       </handler>
 
       <handler event="click" button="0"><![CDATA[
         if (event.getModifierState("Accel") || event.shiftKey) {
           return;
         }
 
         if (gBrowser.multiSelectedTabsCount > 0 &&
-          !this.mOverCloseButton &&
-          !this._overPlayingIcon) {
+            !event.originalTarget.classList.contains("tab-close-button") &&
+            !event.originalTarget.classList.contains("tab-icon-sound") &&
+            !event.originalTarget.classList.contains("tab-icon-overlay")) {
           // Tabs were previously multi-selected and user clicks on a tab
           // without holding Ctrl/Cmd Key
 
           // Force positional attributes to update when the
           // target (of the click) is the "active" tab.
           let updatePositionalAttr = gBrowser.selectedTab == this;
 
           gBrowser.clearMultiSelectedTabs(updatePositionalAttr);
         }
 
-        if (this._overPlayingIcon) {
+        if (event.originalTarget.classList.contains("tab-icon-sound") ||
+            (event.originalTarget.classList.contains("tab-icon-overlay") &&
+             (event.originalTarget.hasAttribute("soundplaying") ||
+              event.originalTarget.hasAttribute("muted")))) {
           if (this.multiselected) {
             gBrowser.toggleMuteAudioOnMultiSelectedTabs(this);
           } else {
             this.toggleMuteAudio();
           }
           return;
         }
 
@@ -2459,17 +2465,18 @@
         if (event.originalTarget.getAttribute("anonid") == "close-button") {
           event.stopPropagation();
         }
 
         let tabContainer = this.parentNode;
         if (tabContainer._closeTabByDblclick &&
             this._selectedOnFirstMouseDown &&
             this.selected &&
-            !this._overPlayingIcon) {
+            !(event.originalTarget.classList.contains("tab-icon-sound") ||
+              event.originalTarget.classList.contains("tab-icon-overlay"))) {
           gBrowser.removeTab(this, {
             animate: true,
             byMouse: event.mozInputSource == MouseEvent.MOZ_SOURCE_MOUSE,
           });
         }
       ]]></handler>
 
       <handler event="animationend">