Skip to content

script: Ensure scheduled timers account for suspension offset.#39880

Merged
jdm merged 1 commit intoservo:mainfrom
jdm:suspended-timer
Oct 15, 2025
Merged

script: Ensure scheduled timers account for suspension offset.#39880
jdm merged 1 commit intoservo:mainfrom
jdm:suspended-timer

Conversation

@jdm
Copy link
Member

@jdm jdm commented Oct 15, 2025

When pages go into the bfcache, rendering engines record when the page is suspended. As part of https://html.spec.whatwg.org/multipage/browsing-the-web.html#reactivate-a-document, any outstanding timers need to have their duration offset by the time since the page was suspended. We used the correct offset when scheduling new timers in a page that has been reactivated, but the wrong offset when dealing with outstanding timers.

Testing: Lots of WPT tests that either pass or no longer timeout.
Fixes: #39545

@jdm jdm requested a review from gterzian as a code owner October 15, 2025 01:53
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Oct 15, 2025
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Oct 15, 2025
@jdm jdm enabled auto-merge October 15, 2025 02:34
@jdm jdm added this pull request to the merge queue Oct 15, 2025
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Oct 15, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 15, 2025
@servo-highfive servo-highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Oct 15, 2025
@yezhizhen
Copy link
Member

The unexpected result is also timer. Is it related to this PR?

@jdm
Copy link
Member Author

jdm commented Oct 15, 2025

Yeah, definitely. I.missed that one in the try results.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
@jdm jdm force-pushed the suspended-timer branch from 47b36ee to 0a9b987 Compare October 15, 2025 12:27
@servo-highfive servo-highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. labels Oct 15, 2025
@jdm jdm enabled auto-merge October 15, 2025 12:27
@jdm jdm added this pull request to the merge queue Oct 15, 2025
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Oct 15, 2025
Merged via the queue into servo:main with commit 383ef76 Oct 15, 2025
31 checks passed
@jdm jdm deleted the suspended-timer branch October 15, 2025 14:10
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-review There is new code that needs to be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New timers scheduled after traversing history don't fire

3 participants