diff --git a/browser/base/content/browser-places.js b/browser/base/content/browser-places.js index 02ccdf2b6340..680b129fb9ad 100644 --- a/browser/base/content/browser-places.js +++ b/browser/base/content/browser-places.js @@ -25,7 +25,7 @@ var StarUI = { element.hidden = false; element.addEventListener("keypress", this, false); element.addEventListener("mouseout", this, false); - element.addEventListener("mousemove", this, false); + element.addEventListener("mouseover", this, false); element.addEventListener("popuphidden", this, false); element.addEventListener("popupshown", this, false); return this.panel = element; @@ -63,7 +63,7 @@ var StarUI = { // nsIDOMEventListener handleEvent(aEvent) { switch (aEvent.type) { - case "mousemove": + case "mouseover": clearTimeout(this._autoCloseTimer); break; case "popuphidden": @@ -138,9 +138,6 @@ var StarUI = { // Explicit fall-through } case "popupshown": - if (aEvent.target != aEvent.currentTarget) { - break; - } // auto-close if new and not interacted with if (this._isNewBookmark) { // 3500ms matches the timeout that Pocket uses in @@ -149,9 +146,7 @@ var StarUI = { if (this._closePanelQuickForTesting) { delay /= 10; } - this._autoCloseTimer = setTimeout(() => { - this.panel.hidePopup(); - }, delay); + this._autoCloseTimer = setTimeout(() => this.panel.hidePopup(), delay, this); } break; } diff --git a/browser/base/content/test/general/browser_bookmark_popup.js b/browser/base/content/test/general/browser_bookmark_popup.js index b8e19e263d56..fa25d949da77 100644 --- a/browser/base/content/test/general/browser_bookmark_popup.js +++ b/browser/base/content/test/general/browser_bookmark_popup.js @@ -122,28 +122,28 @@ add_task(function* panel_shown_for_keyboardshortcut_on_new_bookmark_star_and_aut }); }); -add_task(function* panel_shown_for_new_bookmarks_mousemove_mouseout() { +add_task(function* panel_shown_for_new_bookmarks_mouseover_mouseout() { yield test_bookmarks_popup({ isNewBookmark: true, popupShowFn() { bookmarkStar.click(); }, *popupEditFn() { - let mouseMovePromise = new Promise(resolve => { - bookmarkPanel.addEventListener("mousemove", function onmousemove() { - bookmarkPanel.removeEventListener("mousemove", onmousemove); + let mouseOverPromise = new Promise(resolve => { + bookmarkPanel.addEventListener("mouseover", function onmouseover() { + bookmarkPanel.removeEventListener("mouseover", onmouseover); resolve(); }); }); yield new Promise(resolve => { EventUtils.synthesizeNativeMouseMove(bookmarkPanel, 0, 0, resolve, window); }); - info("Waiting for mousemove event"); - yield mouseMovePromise; - info("Got mousemove event"); + info("Waiting for mouseover event"); + yield mouseOverPromise; + info("Got mouseover event"); yield new Promise(resolve => setTimeout(resolve, 400)); - is(bookmarkPanel.state, "open", "Panel should still be open on mousemove"); + is(bookmarkPanel.state, "open", "Panel should still be open on mouseover"); }, *popupHideFn() { let mouseOutPromise = new Promise(resolve => {