Bug 1555908 - Remove event.target null checks in tabbrowser.xml, r=dao
authorAlexander Surkov <surkov.alexander@gmail.com>
Fri, 31 May 2019 12:23:16 +0000
changeset 476376 f5e4b365f02e5fc063ecee68e455fb88468b8889
parent 476375 74ee6a67d07b08d4ec47636b6cafdff872c10f89
child 476377 4eaea9067bae125fe98db1a76527256636da410e
push id86815
push userasurkov@mozilla.com
push dateFri, 31 May 2019 12:24:11 +0000
treeherderautoland@f5e4b365f02e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs1555908
milestone69.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 1555908 - Remove event.target null checks in tabbrowser.xml, r=dao Differential Revision: https://phabricator.services.mozilla.com/D33266
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -1236,17 +1236,21 @@
         }
       ]]></handler>
 
       <handler event="transitionend"><![CDATA[
         if (event.propertyName != "max-width") {
           return;
         }
 
-        let tab = event.target ? event.target.closest("tab") : null;
+        let tab = event.target.closest("tab");
+        if (!tab) {
+          return;
+        }
+
         if (tab.getAttribute("fadein") == "true") {
           if (tab._fullyOpen) {
             this._updateCloseButtons();
           } else {
             this._handleNewTab(tab);
           }
         } else if (tab.closing) {
           gBrowser._endRemoveTab(tab);
@@ -1327,17 +1331,17 @@
         }
       ]]></handler>
 
       <handler event="click"><![CDATA[
         if (event.button != 1) {
           return;
         }
 
-        let tab = event.target ? event.target.closest("tab") : null;
+        let tab = event.target.closest("tab");
         if (tab) {
           gBrowser.removeTab(tab, {
             animate: true,
             byMouse: event.mozInputSource == MouseEvent.MOZ_SOURCE_MOUSE,
           });
         } else if (event.originalTarget.localName == "scrollbox") {
           // The user middleclicked on the tabstrip. Check whether the click
           // was dispatched on the open space of it.