Skip to content

wpt: Make /_mozilla/mozilla/getBoundingClientRect.html wait for fonts to load - #44248

Merged
TimvdLippe merged 1 commit into
servo:mainfrom
mrobinson:fix-getBoundingClientRect
Apr 15, 2026
Merged

TimvdLippe merged 1 commit into
servo:mainfrom
mrobinson:fix-getBoundingClientRect

Conversation

@mrobinson

@mrobinson mrobinson commented Apr 15, 2026 •

Copy link
Copy Markdown
Member

This is a speculative fix for #39668. Although I could not get this test
to flake locally, it is obviously wrong to assumee that web fonts (Ahem
in this case) is loaded at the time script was run. This change
makes all the tests Promise tests and has them await
document.fonts.ready before running. This should fix the
intermittency.

Testing: This should fix intermittency as seen on the CI.
Fixes: #39668

…ts to load

This is a speculative fix for servo#39668. Although I could not get this test
to flake locally, it is obviously wrong to assumee that web fonts (Ahem
in this case) is loaded at the time of `window.onload`. This change
makes all the tests Promise tests and has them await
`document.fonts.ready` before running. This should fix the
intermittency.

Signed-off-by: Martin Robinson <mrobinson@fastmail.fm>
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 15, 2026
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Apr 15, 2026
@TimvdLippe
TimvdLippe added this pull request to the merge queue Apr 15, 2026
@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 Apr 15, 2026
@jdm

jdm commented Apr 15, 2026

Copy link
Copy Markdown
Member

I bet this was written when we still had a cli flag to make all font loads synchronous.

@mrobinson

Copy link
Copy Markdown
Member Author

I bet this was written when we still had a cli flag to make all font loads synchronous.

That's a very reasonable explanation.

Merged via the queue into servo:main with commit 730fa9d Apr 15, 2026
33 checks passed
@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 Apr 15, 2026
@Loirooriol

Copy link
Copy Markdown
Contributor

it is obviously wrong to assumee that web fonts (Ahem in this case) is loaded at the time of window.onload

Not obviously wrong, in fact some browsers indeed wait for fonts before firing load (w3c/csswg-drafts#1088 (comment))

But this test was running test() synchronously, without waiting for the load event.

@mrobinson

Copy link
Copy Markdown
Member Author

Not obviously wrong, in fact some browsers indeed wait for fonts before firing load (w3c/csswg-drafts#1088 (comment))

Servo does not, so just obvious in the case of Servo, I guess. :)

But this test was running test() synchronously, without waiting for the load event.

Yes, that was a mistake in in the PR message as it was copied from #44247. I'll update it here for future reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Intermittent FAIL in /_mozilla/mozilla/getBoundingClientRect.html

5 participants