Bug 854075 - Use mouseover instead of mouseenter for newtab page; r=jaws
authorTim Taubert <ttaubert@mozilla.com>
Tue, 26 Mar 2013 15:00:59 +0100
changeset 126237 a080b7dba8448687e2850964e8864696a13367fd
parent 126144 31eebe8edba7a679e4dfc9eae7e50eeda6b826e7
child 126238 0713793b80b1e119f75fa0c231dc97010ae3267d
push id24480
push userttaubert@mozilla.com
push dateWed, 27 Mar 2013 10:18:07 +0000
treeherdermozilla-central@0713793b80b1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs854075
milestone22.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 854075 - Use mouseover instead of mouseenter for newtab page; r=jaws
browser/base/content/newtab/sites.js
--- a/browser/base/content/newtab/sites.js
+++ b/browser/base/content/newtab/sites.js
@@ -139,17 +139,17 @@ Site.prototype = {
 
   /**
    * Adds event handlers for the site and its buttons.
    */
   _addEventHandlers: function Site_addEventHandlers() {
     // Register drag-and-drop event handlers.
     this._node.addEventListener("dragstart", this, false);
     this._node.addEventListener("dragend", this, false);
-    this._node.addEventListener("mouseenter", this, false);
+    this._node.addEventListener("mouseover", this, false);
 
     let controls = this.node.querySelectorAll(".newtab-control");
     for (let i = 0; i < controls.length; i++)
       controls[i].addEventListener("click", this, false);
   },
 
   /**
    * Speculatively opens a connection to the current site.
@@ -169,17 +169,18 @@ Site.prototype = {
         aEvent.preventDefault();
         if (aEvent.target.classList.contains("newtab-control-block"))
           this.block();
         else if (this.isPinned())
           this.unpin();
         else
           this.pin();
         break;
-      case "mouseenter":
+      case "mouseover":
+        this._node.removeEventListener("mouseover", this, false);
         this._speculativeConnect();
         break;
       case "dragstart":
         gDrag.start(this, aEvent);
         break;
       case "drag":
         gDrag.drag(this, aEvent);
         break;