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
--- 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>