Bug 1443849 - Part 1: Don't dispatch the TabAttrModified event for the visuallyselected attribute when it hasn't changed. r=Gijs draft
authorDão Gottwald <dao@mozilla.com>
Tue, 13 Mar 2018 14:35:23 +0100
changeset 766890 2e89a40550cef5864b316fc46e717b3bbb267f97
parent 766824 8f1b2f872f0ea358a0412eb8b8687f08d47f6621
child 766891 50efff0e595e9aefcde76a126d5680609d94996a
push id102434
push userdgottwald@mozilla.com
push dateTue, 13 Mar 2018 15:21:11 +0000
reviewersGijs
bugs1443849
milestone61.0a1
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>