From 0c1279749322ff9d4fef5576dcee6784a21116c0 Mon Sep 17 00:00:00 2001 From: Bhuvansh Date: Fri, 12 Jun 2026 15:36:32 +0530 Subject: [PATCH 1/2] Clarify that timeRemaining() is an estimate and not a fixed countdown (#37250) (#44373) * Clarify that IdleDeadline.timeRemaining() can jump to 0 instead of counting down (#37250) * Update timeRemaining() wording and note per review (#37250) * small nit fixes --------- Co-authored-by: Chris Mills --- files/en-us/web/api/idledeadline/timeremaining/index.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/files/en-us/web/api/idledeadline/timeremaining/index.md b/files/en-us/web/api/idledeadline/timeremaining/index.md index 5d11f0e0fec0cd0..748ac4949ed9775 100644 --- a/files/en-us/web/api/idledeadline/timeremaining/index.md +++ b/files/en-us/web/api/idledeadline/timeremaining/index.md @@ -9,17 +9,20 @@ browser-compat: api.IdleDeadline.timeRemaining {{APIRef("Background Tasks")}} The **`timeRemaining()`** method -on the {{domxref("IdleDeadline")}} interface returns the estimated number of -milliseconds remaining in the current idle period. The callback can call this method at +of the {{domxref("IdleDeadline")}} interface returns the estimated number of +milliseconds the user agent will remain idle for. The callback can call this method at any time to determine how much time it can continue to work before it must return. For example, if the callback finishes a task and has another one to begin, it can call `timeRemaining()` to see if there's enough time to complete the next task. If there isn't, the callback can just return immediately, or look for other work to do with the remaining time. -By the time `timeRemaining()` reaches 0, it is suggested that the callback +By the time `timeRemaining()` reaches `0`, it is suggested that the callback should return control to the user agent's event loop. +> [!NOTE] +> The value returned by `timeRemaining()` is an estimate of how much time the user agent believes is available before the next latency-critical task needs to run. This estimate is not fixed and can suddenly drop to 0 if higher-priority work arrives. For example, the browser's estimate can change in the middle of an idle callback if the user clicks. Developers should not assume the value always decreases linearly like a countdown timer. + ## Syntax ```js-nolint From c4e496d0046e0a29f00b4628f910101d8b8c668e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Jun 2026 13:02:23 +0100 Subject: [PATCH 2/2] ci(deps-dev): bump prettier from 3.8.3 to 3.8.4 (#44398) Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0c6c9d2a92ded3e..e3b570b24698af5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,7 +36,7 @@ "markdownlint-rule-search-replace": "1.2.0", "node-html-parser": "^7.1.0", "parse-diff": "^0.12.0", - "prettier": "3.8.3", + "prettier": "3.8.4", "tempy": "^3.2.0", "yaml": "^2.9.0", "yargs": "^18.0.0" @@ -8154,9 +8154,9 @@ } }, "node_modules/prettier": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.3.tgz", - "integrity": "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==", + "version": "3.8.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.4.tgz", + "integrity": "sha512-N2MylSdi48+5N/6S5j+maeHbUSIzzZ5uOcX5Hm4QpV8Dkb1HFjfAKTKX6yNPJQD9AhcT3ifHNB66tWTTJDi11Q==", "dev": true, "license": "MIT", "bin": { diff --git a/package.json b/package.json index 799b6cadd929a2d..8d2373637eae21d 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "markdownlint-rule-search-replace": "1.2.0", "node-html-parser": "^7.1.0", "parse-diff": "^0.12.0", - "prettier": "3.8.3", + "prettier": "3.8.4", "tempy": "^3.2.0", "yaml": "^2.9.0", "yargs": "^18.0.0"