Skip to content

script: Fire FontFaceSet loading events - #50037

Merged
jdm merged 1 commit into
servo:mainfrom
Daniel-1600:fontfaceset-load-events
Nov 18, 2026
Merged

jdm merged 1 commit into
servo:mainfrom
Daniel-1600:fontfaceset-load-events

Conversation

@Daniel-1600

Copy link
Copy Markdown
Contributor

Implemented the onloading, onloadingdone and onloadingerror event handlers on FontFaceSet, and fire the loading and loadingdone events as described in "switch the FontFaceSet to loading" and "switch the FontFaceSet to loaded".

loadingdone is currently fired with an empty fontfaces list, and loadingerror is not fired yet, because Servo doesn't track [[LoadedFonts]] and [[FailedFonts]] yet. That is left for a follow-up.

Testing: This makes css/css-font-loading/fontface-loadingevent.html pass, as well as the onloading* subtests in css/css-font-loading/idlharness.https.html.

Part of #29376

@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Nov 18, 2026
@Daniel-1600
Daniel-1600 force-pushed the fontfaceset-load-events branch from b3c614d to 9e0308d Compare November 18, 2026 12:48
@TimvdLippe TimvdLippe added the T-linux-wpt Do a try run of the WPT label Nov 18, 2026
@github-actions github-actions Bot removed the T-linux-wpt Do a try run of the WPT label Nov 18, 2026
@github-actions

Copy link
Copy Markdown

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

@github-actions

Copy link
Copy Markdown

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

Flaky unexpected result (23)
  • TIMEOUT [expected OK] /IndexedDB/clone-before-keypath-eval.any.sharedworker.html
    • TIMEOUT [expected PASS] subtest: Index key path evaluations operate on a clone

      Test timed out
      

    • TIMEOUT [expected PASS] subtest: Store and index key path evaluations operate on the same clone

      Test timed out
      

    • TIMEOUT [expected PASS] subtest: Cursor update checks and keypath evaluations operate on a clone

      Test timed out
      

    • TIMEOUT [expected PASS] subtest: Blob expando properties are stripped in the clone used for index key path evaluation

      Test timed out
      

  • CRASH [expected ERROR] /IndexedDB/idbcursor-update-exception-order.any.serviceworker.html
  • FAIL [expected PASS] /css/css-backgrounds/background-size-041.html
  • OK /css/css-fonts/variations/at-font-face-font-matching.html (#20684)
    • FAIL [expected PASS] subtest: Matching font-style: 'italic' should prefer 'oblique 30deg 60deg' over 'oblique 40deg 50deg'

      assert_equals: Unexpected font on test element expected 487 but got 532
      

  • OK /css/css-text-decor/parsing/text-decoration-inset-computed.html (#47617)
    • FAIL [expected PASS] subtest: Property text-decoration-inset value '0'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • FAIL [expected PASS] subtest: Property text-decoration-inset value '0px 0px'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • FAIL [expected PASS] subtest: Property text-decoration-inset value '0.5em'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • FAIL [expected PASS] subtest: Property text-decoration-inset value '-1em'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • FAIL [expected PASS] subtest: Property text-decoration-inset value '-1ch -1ch'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • FAIL [expected PASS] subtest: Property text-decoration-inset value '1px 2px'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • FAIL [expected PASS] subtest: Property text-decoration-inset value '1ch -1ch'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • FAIL [expected PASS] subtest: Property text-decoration-inset value 'calc(1em / 4) calc(-1ch)'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • FAIL [expected PASS] subtest: Property text-decoration-inset value 'auto'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • FAIL [expected PASS] subtest: Property text-decoration-inset value '10%'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • And 5 more unexpected results...
  • 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 TIMEOUT] /html/browsers/browsing-the-web/navigating-across-documents/cross-origin-top-navigation-with-user-activation-in-parent.window.html (#48205)
    • FAIL [expected TIMEOUT] subtest: Cross-origin top navigation is blocked without user activation, even if the parent has user activation

      assert_equals: expected "Denied" but got "Allowed"
      

  • TIMEOUT [expected OK] /html/browsers/windows/consume-user-activation/window-open-multi-global.html (#47399)
    • TIMEOUT [expected FAIL] subtest: window.open() and consuming user activation with multiple globals in play

      Test timed out
      

  • TIMEOUT /html/semantics/embedded-content/media-elements/preserves-pitch.html (#49303)
    • PASS [expected TIMEOUT] subtest: Speed-ups should not change the pitch when preservesPitch=true
    • TIMEOUT [expected NOTRUN] subtest: Slow-downs should not change the pitch when preservesPitch=true

      Test timed out
      

  • OK /html/semantics/embedded-content/media-elements/seeking/seek-to-currentTime.html (#46014)
    • FAIL [expected PASS] subtest: seek to currentTime

      assert_greater_than: seekable ranges expected a number greater than 0 but got 0
      

  • ERROR [expected OK] /html/semantics/selectors/pseudo-classes/indeterminate-type-change.html
  • TIMEOUT [expected OK] /html/user-activation/navigation-state-reset-sameorigin.html (#45151)
    • TIMEOUT [expected FAIL] subtest: Post-navigation state reset.

      Test timed out
      

  • 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
      

  • FAIL [expected PASS] /mathml/presentation-markup/operators/mo-form-dynamic-002.html (#49169)
  • PASS [expected FAIL] /mathml/presentation-markup/operators/operator-dictionary-empty-and-three-chars.html (#49173)
  • OK /preload/prefetch-document.html (#37210)
    • PASS [expected FAIL] subtest: different-site document prefetch with 'as=document' should not be consumed
  • 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 /webdriver/tests/classic/close_window/user_prompts.py (#49983)
    • FAIL [expected PASS] subtest: test_default[beforeunload-None]

      webdriver.error.NoSuchElementException: no such element (404)
      

  • OK /webdriver/tests/classic/get_computed_role/get.py
    • ERROR [expected FAIL] subtest: test_no_browsing_context

      setup error: webdriver.error.NoSuchElementException: no such element (404)
      

  • OK /webdriver/tests/classic/get_title/get.py
    • ERROR [expected PASS] subtest: test_no_browsing_context

      setup error: webdriver.error.NoSuchElementException: no such element (404)
      

  • 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'>
      

  • OK /webdriver/tests/classic/switch_to_frame/switch.py
    • FAIL [expected PASS] subtest: test_no_top_browsing_context[None]

      webdriver.error.NoSuchElementException: no such element (404)
      

  • OK [expected TIMEOUT] /webstorage/localstorage-about-blank-3P-iframe-opens-3P-window.partitioned.html (#29053)
    • FAIL [expected TIMEOUT] subtest: StorageKey: test 3P about:blank window opened from a 3P iframe

      assert_true: about:blank window opened by 3P iframe does not inherit 3P iframe's StorageKey expected true got false
      

Stable unexpected results that are known to be intermittent (11)
  • OK /css/CSS2/floats/float-in-block-in-inline-position-001.html (#49534)
    • FAIL [expected PASS] subtest: A line after a bordered block containing a float avoids it at the block's position (sibling)

      assert_equals: the line's block-axis position expected 108 but got 106.35000000000002
      

  • OK /css/CSS2/floats/floats-in-inline-content-intrinsic-size-001.html (#49728)
    • FAIL [expected PASS] subtest: An empty float next to text (emptyFloatAndText, min-content)

      assert_equals: expected 70 but got 50
      

  • OK /css/CSS2/visudet/inline-block-baseline-with-block-in-inline-001.html (#49559)
    • FAIL [expected PASS] subtest: An inline-block whose last line box holds a block level box exports that line's baseline

      assert_equals: the text after the inline-block is aligned to the inline-block's last line box baseline expected 20 but got 18.35
      

  • 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/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"])
      

  • OK /html/webappapis/user-prompts/print-during-unload.html (#35944)
    • FAIL [expected PASS] subtest: print() during unload

      assert_array_equals: expected property 1 to be "destination" but got "error: window.print is not a function" (expected array ["start", "destination"] got ["start", "error: window.print is not a function"])
      

  • ERROR [expected TIMEOUT] /performance-timeline/not-restored-reasons/abort-block-bfcache.window.html (#42802)
  • 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.
  • 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 20.64 but got 20.63
      

  • OK /webdriver/tests/classic/back/user_prompts.py (#49983)
    • FAIL [expected PASS] subtest: test_ignore[prompt]

      AssertionError: assert 'about:blank' == 'https://web-platform.test:8443/webdriver/tests/support/inline.py?doc=%3C%21doctype+html%3E%0A%3Cmeta+charset%3DUTF-8%3E%0A%3Cp+id%3D2%3E&mime=text%2Fhtml&charset=UTF-8'
      

  • OK [expected TIMEOUT] /webdriver/tests/classic/perform_actions/navigation.py (#38822)
Stable unexpected results (2)
  • ERROR [expected TIMEOUT] /css/css-fonts/test_datafont_same_origin.html
  • OK /webdriver/tests/classic/is_element_enabled/enabled.py
    • ERROR [expected PASS] subtest: test_no_top_browsing_context

      setup error: webdriver.error.NoSuchElementException: no such element (404)
      

@github-actions

Copy link
Copy Markdown

⚠️ Try run (#44308823755) failed!

@Daniel-1600
Daniel-1600 force-pushed the fontfaceset-load-events branch from 9e0308d to a788f57 Compare November 18, 2026 15:45
@Daniel-1600
Daniel-1600 force-pushed the fontfaceset-load-events branch from a788f57 to 0cb48ad Compare November 18, 2026 15:47
@@ -1,4 +1,4 @@
[test_datafont_same_origin.html]
expected: TIMEOUT
expected: ERROR

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I checked and this is caused by the test not wrapping the event habdler in t.step_func, so the failed assertion is treated as an uncaught exception.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ooh thanks it now makes a lot of sense , I was actually thinking its because loadingdone returns 0 fonfaces since we are not tracking them at the moment. since 0 != 1 it would be an error.

@jdm jdm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Nov 18, 2026
@jdm
jdm added this pull request to the merge queue Nov 18, 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 18, 2026
Merged via the queue into servo:main with commit 4f3ee1b Nov 18, 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 18, 2026
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