Bug 854075 - Use mouse{over,out} for positional hover attribs on tabs. r=dao
authorAdam Dane [:hobophobe] <unusualtears@gmail.com>
Fri, 29 Mar 2013 16:34:56 -0500
changeset 127259 0653b625b6bbe870839a3ca5426173f4be426fb7
parent 127258 4a8d1a910913870f1056a4b2bbbd838d794e2e50
child 127260 ab72aafa8195518eb873845efd489079187770c7
push id1651
push userjandemooij@gmail.com
push dateMon, 01 Apr 2013 19:51:43 +0000
reviewersdao
bugs854075
milestone22.0a1
Bug 854075 - Use mouse{over,out} for positional hover attribs on tabs. r=dao
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -2921,18 +2921,18 @@
 # right of the newtab button.
         <children includes="tab"/>
 # This is to ensure anything extensions put here will go before the newtab
 # button, necessary due to the previous hack.
         <children/>
         <xul:toolbarbutton class="tabs-newtab-button"
                            command="cmd_newNavigatorTab"
                            onclick="checkForMiddleClick(this, event);"
-                           onmouseenter="document.getBindingParent(this)._enterNewTab();"
-                           onmouseleave="document.getBindingParent(this)._leaveNewTab();"
+                           onmouseover="document.getBindingParent(this)._enterNewTab();"
+                           onmouseout="document.getBindingParent(this)._leaveNewTab();"
                            tooltiptext="&newTabButton.tooltip;"/>
         <xul:spacer class="closing-tabs-spacer" anonid="closing-tabs-spacer"
                     style="width: 0;"/>
       </xul:arrowscrollbox>
     </content>
 
     <implementation implements="nsIDOMEventListener">
       <constructor>
@@ -4263,27 +4263,21 @@
 
       <field name="mOverCloseButton">false</field>
       <field name="mCorrespondingMenuitem">null</field>
       <field name="closing">false</field>
       <field name="lastAccessed">0</field>
     </implementation>
 
     <handlers>
-      <handler event="mouseover">
-        var anonid = event.originalTarget.getAttribute("anonid");
+      <handler event="mouseover"><![CDATA[
+        let anonid = event.originalTarget.getAttribute("anonid");
         if (anonid == "close-button")
           this.mOverCloseButton = true;
-      </handler>
-      <handler event="mouseout">
-        var anonid = event.originalTarget.getAttribute("anonid");
-        if (anonid == "close-button")
-          this.mOverCloseButton = false;
-      </handler>
-      <handler event="mouseenter" phase="target"><![CDATA[
+
         let tab = event.target;
         if (tab.selected)
           return;
 
         let tabContainer = this.parentNode;
         let visibleTabs = tabContainer.tabbrowser.visibleTabs;
         let tabIndex = visibleTabs.indexOf(tab);
         if (tabIndex == 0) {
@@ -4301,17 +4295,21 @@
         } else {
           let candidate = visibleTabs[tabIndex + 1];
           if (!candidate.selected) {
             tabContainer._afterHoveredTab = candidate;
             candidate.setAttribute("afterhovered", "true");
           }
         }
       ]]></handler>
-      <handler event="mouseleave" phase="target"><![CDATA[
+      <handler event="mouseout"><![CDATA[
+        let anonid = event.originalTarget.getAttribute("anonid");
+        if (anonid == "close-button")
+          this.mOverCloseButton = false;
+
         let tabContainer = this.parentNode;
         if (tabContainer._beforeHoveredTab) {
           tabContainer._beforeHoveredTab.removeAttribute("beforehovered");
           tabContainer._beforeHoveredTab = null;
         }
         if (tabContainer._afterHoveredTab) {
           tabContainer._afterHoveredTab.removeAttribute("afterhovered");
           tabContainer._afterHoveredTab = null;