Files
servo/components/script/dom
Martin Robinson a9b9c899ed script: Delay screenshots until the first rendering update after fonts.ready (#39963)
This fixes a regression (likely from #39583) that made the result of
many font loading
tests intermittent. The issues here is that the count of fonts loading
is decremented synchronously in the `FontContext`, but the notification
to the `ScriptThread` happens asynchronously. In between the time the
decrement happens and the `ScriptThread` is notified, a rendering update
could happen which could mark a screenshot as ready to take too soon.

The solution here is to wait until the `fonts.ready` promise is
resolved, which is guaranteed to fire after all fonts have loaded. In
addition, a rendering update is queued after this happens. This means
that the screenshot will wait until that final rendering update to be
ready.

This should remove the flakiness of font load tests.

Testing: This should fix many flaky tests.
Fixes: #39953.
Fixes: #39951.
Fixes #38956.
Fixes #39408.
Fixes #39429.
Fixes #39592.
Fixes #39636.
Fixes #39650.
Fixes #39666.
Fixes #39667.
Fixes #39706.
Fixes #39750.
Fixes #39801.
Fixes #39853.
Fixes #39881.
Fixes #39950.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-10-17 17:48:19 +00:00
..
2025-10-02 07:51:19 +00:00
2025-08-19 11:07:53 +00:00
2025-08-19 11:07:53 +00:00
2025-08-21 22:54:19 +00:00