summaryrefslogtreecommitdiffstats
path: root/browser/base/content/tabbrowser-tab.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /browser/base/content/tabbrowser-tab.js
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz
firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/base/content/tabbrowser-tab.js')
-rw-r--r--browser/base/content/tabbrowser-tab.js30
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 }));
}