Skip to content

script: Track loaded and failed FontFaceSet fonts - #50195

Merged
TimvdLippe merged 1 commit into
servo:mainfrom
Daniel-1600:fontfaceset-track-fonts
Nov 26, 2026
Merged

TimvdLippe merged 1 commit into
servo:mainfrom
Daniel-1600:fontfaceset-track-fonts

Conversation

@Daniel-1600

Copy link
Copy Markdown
Contributor

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

@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

🤖 Opened new upstream WPT pull request (web-platform-tests/wpt#65671) with upstreamable changes.

@Daniel-1600
Daniel-1600 force-pushed the fontfaceset-track-fonts branch from 44a23bd to bb05407 Compare November 24, 2026 23:01
@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#65671).

@TimvdLippe TimvdLippe added the T-linux-wpt Do a try run of the WPT label Nov 25, 2026
@github-actions github-actions Bot removed the T-linux-wpt Do a try run of the WPT label Nov 25, 2026
@github-actions

Copy link
Copy Markdown

🔨 Triggering try run (#45595772035) for Linux (WPT)

@TimvdLippe TimvdLippe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Some minor comments, but overall LGTM

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Nov 25, 2026
@github-actions

Copy link
Copy Markdown

Test results for linux-wpt from try job (#45595772035):

Flaky unexpected result (20)
  • TIMEOUT [expected OK] /IndexedDB/event-dispatch-active-flag.any.worker.html
    • TIMEOUT [expected PASS] subtest: Active during success handlers

      Test timed out
      

    • TIMEOUT [expected PASS] subtest: Active during success listeners

      Test timed out
      

  • CRASH [expected OK] /IndexedDB/idbfactory-deleteDatabase-opaque-origin.html
  • OK /beacon/beacon-basic.https.window.html (#41723)
    • FAIL [expected PASS] subtest: Payload size restriction should be accumulated: type = blob

      assert_false: expected false got true
      

  • FAIL [expected PASS] /css/css-backgrounds/background-size-042.html
  • TIMEOUT [expected PASS] /dom/nodes/moveBefore/moveBefore-range-iframe-crash.html
  • CRASH [expected ERROR] /fetch/fetch-later/quota/cross-origin-iframe/empty-payload.https.window.html
  • TIMEOUT /fetch/metadata/generated/css-images.https.sub.tentative.html
    • FAIL [expected PASS] subtest: content sec-fetch-site - Same origin

      assert_unreached: Reached unreachable code
      

    • FAIL [expected PASS] subtest: content sec-fetch-site - Same site

      assert_unreached: Reached unreachable code
      

    • FAIL [expected PASS] subtest: content sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect

      assert_unreached: Reached unreachable code
      

    • FAIL [expected PASS] subtest: content sec-fetch-site - Same-Origin -> Same-Site -> Same-Origin redirect

      assert_unreached: Reached unreachable code
      

    • FAIL [expected PASS] subtest: content sec-fetch-site - Cross-Site -> Same Origin

      assert_unreached: Reached unreachable code
      

    • FAIL [expected PASS] subtest: content sec-fetch-site - Cross-Site -> Same-Site

      assert_unreached: Reached unreachable code
      

    • FAIL [expected PASS] subtest: content sec-fetch-site - Cross-Site -> Cross-Site

      assert_unreached: Reached unreachable code
      

    • FAIL [expected PASS] subtest: content sec-fetch-site - Same-Origin -> Same Origin

      assert_unreached: Reached unreachable code
      

    • FAIL [expected PASS] subtest: content sec-fetch-site - Same-Origin -> Same-Site

      assert_unreached: Reached unreachable code
      

    • FAIL [expected PASS] subtest: content sec-fetch-site - Same-Origin -> Cross-Site

      assert_unreached: Reached unreachable code
      

    • And 9 more unexpected results...
  • CRASH [expected TIMEOUT] /html/browsers/the-window-object/open-close/open-features-is-popup-condition.html?combination
  • OK /html/semantics/scripting-1/the-script-element/execution-timing/077.html (#22139)
    • FAIL [expected PASS] subtest: adding several types of scripts through the DOM and removing some of them confuses scheduler

      assert_array_equals: expected property 1 to be "Script #1 ran" but got "Script #3 ran" (expected array ["Script #2 ran", "Script #1 ran", "Script #3 ran", "Script #4 ran"] got ["Script #2 ran", "Script #3 ran", "Script #4 ran", "Script #1 ran"])
      

  • TIMEOUT [expected OK] /html/user-activation/navigation-state-reset-sameorigin.html (#45151)
    • TIMEOUT [expected FAIL] subtest: Post-navigation state reset.

      Test timed out
      

  • FAIL [expected PASS] /mathml/presentation-markup/operators/mo-form-dynamic-002.html (#49169)
  • TIMEOUT [expected OK] /pointerevents/compat/pointerevent_touch-action_two-finger_interaction.html (#50155)
    • NOTRUN [expected PASS] subtest: touch two-finger pan on 'touch-action: pan-x pan-y'
    • NOTRUN [expected FAIL] subtest: touch two-finger pan on 'touch-action: pinch-zoom'
  • OK /upgrade-insecure-requests/gen/sharedworker-classic-data.meta/upgrade/websocket.https.html
    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects allowed for websocket to cross-ws-downgrade origin and no-redirect redirection from https context.

      assert_equals: The resource request should be 'allowed'. expected "allowed" but got "blocked"
      

    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects allowed for websocket to same-ws-downgrade origin and no-redirect redirection from https context.

      assert_equals: The resource request should be 'allowed'. expected "allowed" but got "blocked"
      

  • OK /upgrade-insecure-requests/gen/sharedworker-module-data.meta/unset/fetch.https.html
    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects blocked for fetch to cross-http-downgrade origin and downgrade redirection from https context.

      assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
      

    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects blocked for fetch to cross-http-downgrade origin and no-redirect redirection from https context.

      assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
      

    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects blocked for fetch to cross-https origin and downgrade redirection from https context.

      assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
      

    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects blocked for fetch to same-http-downgrade origin and downgrade redirection from https context.

      assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
      

    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects blocked for fetch to same-http-downgrade origin and no-redirect redirection from https context.

      assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
      

    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects blocked for fetch to same-https origin and downgrade redirection from https context.

      assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
      

  • OK /user-timing/measure_associated_with_navigation_timing.html (#47273)
    • FAIL [expected PASS] subtest: loadTime plus loadEventEnd to a mark "a" should equal to navigationStart to "a".

      assert_equals: loadTime plus loadEventEnd to a mark "a" should equal to navigationStart to "a". expected 14.58 but got 14.57
      

  • OK /webdriver/tests/classic/external/global_privacy_control/set.py
    • ERROR [expected FAIL] subtest: test_set_gpc_success[True]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected FAIL] subtest: test_set_gpc_success[False]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_set_gpc_failure[None]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_set_gpc_failure[1]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_set_gpc_failure[hello]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_set_gpc_failure[value3]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_set_gpc_failure[value4]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

  • OK /webdriver/tests/classic/external/webauthn/remove_virtual_authenticator/remove.py
    • ERROR [expected FAIL] subtest: test_remove_virtual_authenticator

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

  • OK /webdriver/tests/classic/find_elements_from_element/user_prompts.py
    • ERROR [expected PASS] subtest: test_accept[alert-None]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_accept[confirm-True]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_accept[prompt-]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_accept_and_notify[alert-None]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_accept_and_notify[confirm-True]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_accept_and_notify[prompt-]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_dismiss[alert-None]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_dismiss[confirm-False]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_dismiss[prompt-None]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_dismiss_and_notify[alert-None]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • And 8 more unexpected results...
  • OK /webdriver/tests/classic/get_current_url/user_prompts.py
    • ERROR [expected PASS] subtest: test_accept[alert-None]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_accept[confirm-True]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_accept[prompt-]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_accept_and_notify[alert-None]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_accept_and_notify[confirm-True]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_accept_and_notify[prompt-]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_dismiss[alert-None]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_dismiss[confirm-False]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_dismiss[prompt-None]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_dismiss_and_notify[alert-None]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • And 8 more unexpected results...
  • OK /webdriver/tests/classic/perform_actions/pointer_mouse.py (#49662)
    • FAIL [expected PASS] subtest: test_down_closes_browsing_context[without up]

      Failed: DID NOT RAISE <class 'webdriver.error.NoSuchWindowException'>
      

Stable unexpected results that are known to be intermittent (8)
  • OK [expected TIMEOUT] /fetch/api/redirect/redirect-keepalive.https.any.html (#32153)
    • PASS [expected TIMEOUT] subtest: [keepalive][iframe][load] mixed content redirect; setting up
  • OK [expected ERROR] /focus/focus-event-after-switching-iframes.sub.html (#40368)
  • OK /html/browsers/browsing-the-web/navigating-across-documents/refresh/same-document-refresh.html (#34597)
    • FAIL [expected PASS] subtest: Same-Document Referrer from Refresh

      assert_equals: original page loads expected "http://web-platform.test:8000/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/refresh-with-section.sub.html?url=%23section" but got "http://web-platform.test:8000/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/refresh-with-section.sub.html?url=%23section#section"
      

  • TIMEOUT /html/browsers/history/the-history-interface/001.html (#12580)
    • FAIL [expected PASS] subtest: traversing history must also traverse hash changes

      assert_equals: (this could cause other failures later on) expected "" but got "test"
      

  • OK /html/syntax/speculative-parsing/expect-no-linked-resources/no-speculative-fetch.tentative.optional.html (#47290)
    • PASS [expected FAIL] subtest: expect-no-linked-resources hint was ignored
  • OK /infrastructure/testdriver/click_window.html (#47303)
    • FAIL [expected PASS] subtest: TestDriver click method in window

      Unhandled rejection: assert_unreached: click failed Reached unreachable code
      

  • PASS [expected FAIL] /mathml/presentation-markup/operators/mo-lspace-rspace-dynamic.html (#49168)
  • OK /pointerevents/pointerevent_pointercapture_in_frame.html?pen (#45536)
    • PASS [expected FAIL] subtest: Test penpointer capture in same-origin frame: Pointer down at inner frame and set pointer capture.
    • PASS [expected FAIL] subtest: Test penpointer capture in same-origin frame: Pointer down at inner frame and set pointer capture to outer frame should not capture.

@github-actions

Copy link
Copy Markdown

✨ Try run (#45595772035) succeeded.

@Daniel-1600
Daniel-1600 force-pushed the fontfaceset-track-fonts branch from bb05407 to 03eb2af Compare November 25, 2026 22:43
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Nov 25, 2026
@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#65671).

@Daniel-1600
Daniel-1600 force-pushed the fontfaceset-track-fonts branch from 03eb2af to 57108cd Compare November 25, 2026 22:47
@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#65671).

@TimvdLippe TimvdLippe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for adding the additional comments!

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Nov 26, 2026
@TimvdLippe
TimvdLippe added this pull request to the merge queue Nov 26, 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 Nov 26, 2026
Merged via the queue into servo:main with commit 8dd671a Nov 26, 2026
35 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 Nov 26, 2026
devin-ai-integration Bot pushed a commit to baigojahanzaib/servo that referenced this pull request Nov 27, 2026
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: servo#29376

Signed-off-by: Daniel Mungai <[email protected]>
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.

4 participants