mirror of
https://github.com/servo/servo
synced 2026-05-14 10:56:44 +02:00
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>
156 KiB
156 KiB