Bug 1443849 - Part 1: Don't dispatch the TabAttrModified event for the visuallyselected attribute when it hasn't changed. r=Gijs
authorDão Gottwald <dao@mozilla.com>
Tue, 13 Mar 2018 14:35:23 +0100
changeset 462701 be52d88a3808a7bb7149fb4d63109bb80be9df00
parent 462700 79248272d2901be36f74a075775ac5fcf6eae566
child 462702 33a701f7e76c2ad1ffa09694de649db521819e7b
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1443849
milestone60.0
Bug 1443849 - Part 1: Don't dispatch the TabAttrModified event for the visuallyselected attribute when it hasn't changed. r=Gijs MozReview-Commit-ID: E3PNS8OaG0Z
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -1617,21 +1617,26 @@
         if (!("_lastAccessed" in this)) {
           this.updateLastAccessed();
         }
       ]]></constructor>
 
       <property name="_visuallySelected">
         <setter>
           <![CDATA[
-          if (val)
+          if (val == (this.getAttribute("visuallyselected") == "true")) {
+            return val;
+          }
+
+          if (val) {
             this.setAttribute("visuallyselected", "true");
-          else
+          } else {
             this.removeAttribute("visuallyselected");
-          this.parentNode.tabbrowser._tabAttrModified(this, ["visuallyselected"]);
+          }
+          gBrowser._tabAttrModified(this, ["visuallyselected"]);
 
           return val;
           ]]>
         </setter>
       </property>
 
       <property name="_selected">
         <setter>