diff options
Diffstat (limited to 'browser/base/content/tabbrowser-tab.js')
-rw-r--r-- | browser/base/content/tabbrowser-tab.js | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/browser/base/content/tabbrowser-tab.js b/browser/base/content/tabbrowser-tab.js index 01bb7ee90b..ed3d4bb727 100644 --- a/browser/base/content/tabbrowser-tab.js +++ b/browser/base/content/tabbrowser-tab.js @@ -350,7 +350,20 @@ count: affectedTabsLength, }); } - this._mouseenter(); + + if (this.hidden || this.closing) { + return; + } + + let tabToWarm = this.mOverCloseButton + ? gBrowser._findTabToBlurTo(this) + : this; + gBrowser.warmupTab(tabToWarm); + + // If the previous target wasn't part of this tab then this is a mouseenter event. + if (!this.contains(event.relatedTarget)) { + this._mouseenter(); + } } on_mouseout(event) { @@ -360,7 +373,11 @@ if (event.target == this.overlayIcon) { this.setSecondaryTabTooltipLabel(null); } - this._mouseleave(); + + // If the new target is not part of this tab then this is a mouseleave event. + if (!this.contains(event.relatedTarget)) { + this._mouseleave(); + } } on_dragstart(event) { @@ -530,9 +547,6 @@ } _mouseenter() { - if (this.hidden || this.closing) { - return; - } this._hover = true; if (this.selected) { @@ -545,12 +559,6 @@ // Prepare connection to host beforehand. SessionStore.speculativeConnectOnTabHover(this); - let tabToWarm = this; - if (this.mOverCloseButton) { - tabToWarm = gBrowser._findTabToBlurTo(this); - } - gBrowser.warmupTab(tabToWarm); - this.dispatchEvent(new CustomEvent("TabHoverStart", { bubbles: true })); } |