Skip to content

script: Track loaded and failed FontFaceSet fonts - #65671

Merged
servo-wpt-sync merged 1 commit into
web-platform-tests:masterfrom
servo:servo_export_50195
Nov 26, 2026
Merged

servo-wpt-sync merged 1 commit into
web-platform-tests:masterfrom
servo:servo_export_50195

Conversation

@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

Implemented the [[LoadingFonts]], [[LoadedFonts]] and [[FailedFonts]] slots of FontFaceSet and use them when switching the set to loaded, so that the loadingdone event now carries the fonts that finished loading and loadingerror is fired with the fonts that failed. Previously loadingdone always had an empty fontfaces list and loadingerror was never fired.

  • Fonts are added to [[LoadingFonts]] when they start loading, and moved to [[LoadedFonts]] or [[FailedFonts]] when they finish. The set now only switches to loading when [[LoadingFonts]] was empty, as the spec requires.
  • delete() and clear() now also remove fonts from these lists. Delete needs a JSContext for this, so it was added to Bindings.conf.

I havent covered the css-declared fonts in this pr will cover that on follow up pr

Testing: Added two new WPT tests, css/css-font-loading/fontfaceset-loadingdone-event.html and css/css-font-loading/fontfaceset-loadingerror-event.html.
Part of: #29376

Reviewed in servo/servo#50195

@wpt-pr-bot wpt-pr-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Servo project.

@servo-wpt-sync
servo-wpt-sync force-pushed the servo_export_50195 branch 2 times, most recently from 28b70cd to 4c9db25 Compare November 25, 2026 22:46
@servo-wpt-sync
servo-wpt-sync merged commit 0771eda into web-platform-tests:master Nov 26, 2026
30 checks passed
@servo-wpt-sync
servo-wpt-sync deleted the servo_export_50195 branch November 26, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants