summaryrefslogtreecommitdiffstats
path: root/browser/base/content/tabbrowser-tab.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:50 +0000
commitdef92d1b8e9d373e2f6f27c366d578d97d8960c6 (patch)
tree2ef34b9ad8bb9a9220e05d60352558b15f513894 /browser/base/content/tabbrowser-tab.js
parentAdding debian version 125.0.3-1. (diff)
downloadfirefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.tar.xz
firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.zip
Merging upstream version 126.0.
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.js26
1 files changed, 21 insertions, 5 deletions
diff --git a/browser/base/content/tabbrowser-tab.js b/browser/base/content/tabbrowser-tab.js
index ed3d4bb727..807a7d93fd 100644
--- a/browser/base/content/tabbrowser-tab.js
+++ b/browser/base/content/tabbrowser-tab.js
@@ -259,6 +259,14 @@
return this._lastAccessed == Infinity ? Date.now() : this._lastAccessed;
}
+ /**
+ * Returns a timestamp which attempts to represent the last time the user saw this tab.
+ * If the tab has not been active in this session, any lastAccessed is used. We
+ * differentiate between selected and explicitly visible; a selected tab in a hidden
+ * window is last seen when that window and tab were last visible.
+ * We use the application start time as a fallback value when no other suitable value
+ * is available.
+ */
get lastSeenActive() {
const isForegroundWindow =
this.ownerGlobal ==
@@ -270,8 +278,16 @@
if (this._lastSeenActive) {
return this._lastSeenActive;
}
- // Use the application start time as the fallback value
- return Services.startup.getStartupInfo().start.getTime();
+
+ const appStartTime = Services.startup.getStartupInfo().start.getTime();
+ if (!this._lastAccessed || this._lastAccessed >= appStartTime) {
+ // When the tab was created this session but hasn't been seen by the user,
+ // default to the application start time.
+ return appStartTime;
+ }
+ // The tab was restored from a previous session but never seen.
+ // Use the lastAccessed as the best proxy for when the user might have seen it.
+ return this._lastAccessed;
}
get _overPlayingIcon() {
@@ -457,7 +473,7 @@
}
}
- on_mouseup(event) {
+ on_mouseup() {
// Make sure that clear-selection is released.
// Otherwise selection using Shift key may be broken.
gBrowser.unlockClearMultiSelection();
@@ -706,11 +722,11 @@
this.setAttribute("aria-describedby", "tabbrowser-tab-a11y-desc");
}
- on_focus(event) {
+ on_focus() {
this.updateA11yDescription();
}
- on_AriaFocus(event) {
+ on_AriaFocus() {
this.updateA11yDescription();
}
}