Skip to content

Add WebFontDocumentContext for CSS Fonts 4 font fetching - #37021

Closed
uthmaniv wants to merge 5 commits into
servo:mainfrom
uthmaniv:issue_36590
Closed

uthmaniv wants to merge 5 commits into
servo:mainfrom
uthmaniv:issue_36590

Conversation

@uthmaniv

@uthmaniv uthmaniv commented May 16, 2025 •

Copy link
Copy Markdown
Member

Implements font fetching requirements for CSS Fonts 4 spec by introducing WebFontDocumentContext.

  • Introduces WebFontDocumentContext in components/fonts/font_context.rs with fields for policy container, document URL, trustworthy ancestor origin, and insecure requests policy;.
  • Adds WebFontDocumentContext as an argument to FontContextWebFontMethods::add_all_web_fonts_from_stylesheet, FontContextWebFontMethods::load_web_font_for_script, and FontContext::start_loading_one_web_font in font_context.rs.
  • Includes WebFontDocumentContext in WebFontDownloadState and updates RequestBuilder fields using its values and CSS Fonts 4 constants.
  • Adds WebFontDocumentContext to ReflowRequest in force_reflow (window.rs), constructed with self.global().
  • Updates Layout trait in script_layout/lib.rs to include &WebFontDocumentContext in add_stylesheet and load_web_fonts_from_stylesheet.
  • Modifies document.rs to construct WebFontDocumentContext using self.window.global() for add_stylesheet and load_web_fonts_from_stylesheet calls.
  • Updates layout_thread.rs to use reflow_request.document_context in handle_reflow for load_all_web_fonts_from_stylesheet_with_guard.
  • Updates WPT expectations for referrer-policy/css-integration/font-face (removed .ini as tests pass) and content-security-policy/font-src.
    Testing:
    -Ran WPT tests: ./mach test-wpt --release tests/wpt/tests/referrer-policy/css-integration/font-face tests/wpt/tests/content-security-policy/font-src
  • Updated expectations with ./mach update-wpt, confirming tests pass
    Fixes: Web font requests are missing many settings #36590

@jdm jdm added the T-linux-wpt Do a try run of the WPT label May 16, 2025
@github-actions github-actions Bot removed the T-linux-wpt Do a try run of the WPT label May 16, 2025
@github-actions

Copy link
Copy Markdown

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

@github-actions

Copy link
Copy Markdown

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

Flaky unexpected result (19)
  • CRASH [expected ERROR] /_webgl/conformance/extensions/oes-texture-half-float-with-canvas.html
  • OK /_webgl/conformance/textures/misc/texture-upload-size.html (#21770)
    • FAIL [expected PASS] subtest: WebGL test #68

      assert_true: could not create image (SVG) expected true got false
      

  • OK /content-security-policy/frame-ancestors/frame-ancestors-path-ignored.window.html (#36468)
    • PASS [expected FAIL] subtest: A 'frame-ancestors' CSP directive with a URL that includes a path should be ignored.
  • OK /css/css-align/blocks/align-content-block-002.html
    • FAIL [expected PASS] subtest: .test 1: start

      assert_equals: 
      <div class="test" style="align-content: start" title="start">
          <div class="in-flow" data-offset-y="15"></div>
          <div class="in-flow">
            <span class="label">START</span>
            <span class="abspos" data-offset-y="0">ABS</span>
            <span class="relpos" data-offset-y="0">REL</span>
            <div class="overflow">OVERFLOW</div>
          </div>
        </div>
      offsetTop expected 0 but got -1
      

    • FAIL [expected PASS] subtest: .test 4: baseline

      assert_equals: 
      <div class="test" style="align-content: baseline" title="baseline">
          <div class="in-flow" data-offset-y="15"></div>
          <div class="in-flow">
            <span class="label">BASELINE</span>
            <span class="abspos" data-offset-y="0">ABS</span>
            <span class="relpos" data-offset-y="0">REL</span>
            <div class="overflow">OVERFLOW</div>
          </div>
        </div>
      offsetTop expected 0 but got -1
      

    • FAIL [expected PASS] subtest: .test 6: flex-start

      assert_equals: 
      <div class="test" style="align-content: flex-start" title="flex-start">
          <div class="in-flow" data-offset-y="15"></div>
          <div class="in-flow">
            <span class="label">FLEX-START</span>
            <span class="abspos" data-offset-y="0">ABS</span>
            <span class="relpos" data-offset-y="0">REL</span>
            <div class="overflow">OVERFLOW</div>
          </div>
        </div>
      offsetTop expected 0 but got -1
      

    • FAIL [expected PASS] subtest: .test 8: unsafe start

      assert_equals: 
      <div class="test" style="align-content: unsafe start" title="unsafe start">
          <div class="in-flow" data-offset-y="15"></div>
          <div class="in-flow">
            <span class="label">UNSAFE START</span>
            <span class="abspos" data-offset-y="0">ABS</span>
            <span class="relpos" data-offset-y="0">REL</span>
            <div class="overflow">OVERFLOW</div>
          </div>
        </div>
      offsetTop expected 0 but got -1
      

    • FAIL [expected PASS] subtest: .test 11: safe start

      assert_equals: 
      <div class="test" style="align-content: safe start" title="safe start">
          <div class="in-flow" data-offset-y="15"></div>
          <div class="in-flow">
            <span class="label">SAFE START</span>
            <span class="abspos" data-offset-y="0">ABS</span>
            <span class="relpos" data-offset-y="0">REL</span>
            <div class="overflow">OVERFLOW</div>
          </div>
        </div>
      offsetTop expected 0 but got -1
      

    • FAIL [expected PASS] subtest: .test 15: space-between

      assert_equals: 
      <div class="test" style="align-content: space-between" title="space-between">
          <div class="in-flow" data-offset-y="15"></div>
          <div class="in-flow">
            <span class="label">SPACE-BETWEEN</span>
            <span class="abspos" data-offset-y="0">ABS</span>
            <span class="relpos" data-offset-y="0">REL</span>
            <div class="overflow">OVERFLOW</div>
          </div>
        </div>
      offsetTop expected 0 but got -1
      

    • FAIL [expected PASS] subtest: .test 17: normal

      assert_equals: 
      <div class="test" style="align-content: normal" title="normal">
          <div class="in-flow" data-offset-y="10"></div>
          <div class="in-flow">
            <span class="label">NORMAL</span>
            <span class="abspos" data-offset-y="-5">ABS</span>
            <span class="relpos" data-offset-y="-5">REL</span>
            <div class="overflow">OVERFLOW</div>
          </div>
        </div>
      offsetTop expected -5 but got -6
      

  • ERROR /fetch/metadata/generated/serviceworker.https.sub.html (#36247)
    • PASS [expected FAIL] subtest: sec-fetch-site - Same origin, no options - registration
  • OK /html/browsers/history/the-history-interface/traverse_the_history_5.html (#21383)
    • PASS [expected FAIL] subtest: Multiple history traversals, last would be aborted
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.draw.align.end.ltr.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.draw.align.start.rtl.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.measure.emHeights.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.measure.fillTextCluster-range.tentative.html
  • TIMEOUT [expected OK] /html/infrastructure/urls/base-url/document-base-url-window-initiator-is-not-opener.https.window.html (#30970)
  • TIMEOUT [expected OK] /html/interaction/focus/the-autofocus-attribute/autofocus-dialog.html (#29087)
    • TIMEOUT [expected FAIL] subtest: <dialog>-contained autofocus element gets focused when the dialog is shown

      Test timed out
      

  • CRASH [expected OK] /html/semantics/embedded-content/media-elements/track/track-element/track-remove-by-setting-innerHTML.html (#36789)
  • OK [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-1.html (#22647)
    • FAIL [expected TIMEOUT] subtest: Check that popups from a sandboxed iframe escape the sandbox if allow-popups-to-escape-sandbox is used

      assert_equals: It came from a sandboxed iframe expected "null" but got "http://web-platform.test:8000"
      

  • OK /html/semantics/scripting-1/the-script-element/module/dynamic-import/blob-url.any.html (#33948)
    • FAIL [expected PASS] subtest: Revoking a blob URL immediately after calling import will not fail

      promise_test: Unhandled rejection with value: object "TypeError: Dynamic import failed"
      

  • CRASH [expected OK] /webmessaging/message-channels/worker-post-after-close.any.worker.html
  • TIMEOUT [expected OK] /webmessaging/without-ports/018.html (#24485)
    • TIMEOUT [expected PASS] subtest: origin of the script that invoked the method, javascript:

      Test timed out
      

  • OK /workers/WorkerGlobalScope-close.html (#23064)
    • PASS [expected FAIL] subtest: Test sending a message after closing.
  • ERROR [expected OK] /workers/constructors/Worker/Worker-constructor.html (#22991)
Stable unexpected results that are known to be intermittent (19)
  • FAIL [expected PASS] /_mozilla/css/iframe/hide_and_show.html (#15265)
  • FAIL [expected PASS] /_mozilla/gfx-rs-gecko/descriptor-ranges.html (#23258)
  • TIMEOUT [expected OK] /_mozilla/mozilla/window_resizeTo.html (#36741)
    • TIMEOUT [expected PASS] subtest: Popup onresize event fires after resizeTo

      Test timed out
      

  • TIMEOUT [expected OK] /css/css-fonts/variations/at-font-face-font-matching.html (#20684)
    • FAIL [expected PASS] subtest: Descriptor matching priority: Stretch has higher priority than style

      assert_not_equals: Sanity test: different family get different width got disallowed value 310
      

    • FAIL [expected PASS] subtest: Descriptor matching priority: Stretch has higher priority than weight

      assert_not_equals: Sanity test: different family get different width got disallowed value 310
      

    • FAIL [expected PASS] subtest: Descriptor matching priority: Style has higher priority than weight

      assert_not_equals: Sanity test: different family get different width got disallowed value 310
      

    • TIMEOUT [expected PASS] subtest: Matching font-weight: '400' should prefer '400' over '450 460'

      Test timed out
      

    • NOTRUN [expected PASS] subtest: Matching font-weight: '400' should prefer '450 460' over '500'
    • NOTRUN [expected PASS] subtest: Matching font-weight: '400' should prefer '500' over '350 399'
    • NOTRUN [expected PASS] subtest: Matching font-weight: '400' should prefer '350 399' over '351 398'
    • NOTRUN [expected PASS] subtest: Matching font-weight: '400' should prefer '351 398' over '501 550'
    • NOTRUN [expected PASS] subtest: Matching font-weight: '400' should prefer '501 550' over '502 560'
    • NOTRUN [expected PASS] subtest: Matching font-weight: '430' should prefer '420 440' over '450 460'
    • And 97 more unexpected results...
  • OK /css/css-grid/alignment/grid-content-alignment-with-abspos-001.html (#34339)
    • PASS [expected FAIL] subtest: .grid 1
  • OK [expected ERROR] /fetch/fetch-later/quota/same-origin-iframe/multiple-iframes.tentative.https.window.html (#35176)
  • OK /fetch/metadata/generated/css-font-face.https.sub.tentative.html (#32732)
    • PASS [expected FAIL] subtest: sec-fetch-mode
    • PASS [expected FAIL] subtest: sec-fetch-dest
    • PASS [expected FAIL] subtest: sec-fetch-storage-access - Same site
  • OK /fetch/metadata/generated/css-font-face.sub.tentative.html (#34624)
    • PASS [expected FAIL] subtest: sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination
  • OK /html/browsers/browsing-the-web/navigating-across-documents/009.html (#24456)
    • FAIL [expected PASS] subtest: Link with onclick form submit to javascript url with document.write and href navigation

      assert_array_equals: expected property 1 to be "href" but got "click" (expected array ["write", "href"] got ["write", "click"])
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-nosrc.html (#34819)
    • PASS [expected FAIL] subtest: link click
    • FAIL [expected PASS] subtest: form submission

      assert_equals: expected "http://web-platform.test:8000/common/blank.html?1=" but got "about:blank"
      

  • OK /html/browsers/history/the-history-interface/traverse_the_history_3.html (#21383)
    • FAIL [expected PASS] subtest: Multiple history traversals, last would be aborted

      assert_array_equals: Pages opened during history navigation lengths differ, expected array [6, 3] length 2, got [6, 2, 2] length 3
      

  • TIMEOUT /html/canvas/element/manual/imagebitmap/createImageBitmap-origin.sub.html (#31931)
    • TIMEOUT [expected FAIL] subtest: cross-origin HTMLVideoElement: origin unclear 2dContext.drawImage

      Test timed out
      

    • NOTRUN [expected FAIL] subtest: cross-origin HTMLVideoElement: origin unclear bitmaprenderer.transferFromImageBitmap
    • NOTRUN [expected FAIL] subtest: redirected to cross-origin HTMLVideoElement: origin unclear getImageData
    • NOTRUN [expected FAIL] subtest: redirected to cross-origin HTMLVideoElement: origin unclear 2dContext.drawImage
    • NOTRUN [expected FAIL] subtest: redirected to cross-origin HTMLVideoElement: origin unclear bitmaprenderer.transferFromImageBitmap
    • NOTRUN [expected FAIL] subtest: redirected to same-origin HTMLVideoElement: origin unclear getImageData
    • NOTRUN [expected FAIL] subtest: redirected to same-origin HTMLVideoElement: origin unclear 2dContext.drawImage
    • NOTRUN [expected FAIL] subtest: redirected to same-origin HTMLVideoElement: origin unclear bitmaprenderer.transferFromImageBitmap
    • NOTRUN [expected FAIL] subtest: unclean HTMLCanvasElement: origin unclear getImageData
    • NOTRUN [expected FAIL] subtest: unclean HTMLCanvasElement: origin unclear 2dContext.drawImage
    • And 4 more unexpected results...
  • OK [expected TIMEOUT] /html/interaction/focus/the-autofocus-attribute/supported-elements.html (#24145)
    • FAIL [expected NOTRUN] subtest: Host element with delegatesFocus should support autofocus

      assert_equals: expected Element node <div autofocus=""></div> but got Element node <body><div autofocus=""></div></body>
      

    • FAIL [expected NOTRUN] subtest: Host element with delegatesFocus including no focusable descendants should be skipped

      assert_equals: expected Element node <input autofocus=""></input> but got null
      

    • FAIL [expected NOTRUN] subtest: Area element should support autofocus

      assert_equals: expected Element node <area autofocus="" href="/common/blank.html"></area> but got Element node <body>
      <img src="/media/poster.png" usemap="#map">
      <map n...
      

  • TIMEOUT /html/semantics/embedded-content/the-canvas-element/security.pattern.fillStyle.sub.html (#36989)
    • FAIL [expected TIMEOUT] subtest: redirected to same-origin HTMLVideoElement: Setting fillStyle to an origin-unclean pattern makes the canvas origin-unclean

      promise_test: Unhandled rejection with value: object "TypeError: argument could not be converted to any of: HTMLImageElement, HTMLCanvasElement, OffscreenCanvas, CSSStyleValue"
      

    • PASS [expected NOTRUN] subtest: unclean HTMLCanvasElement: Setting fillStyle to an origin-unclean pattern makes the canvas origin-unclean
    • FAIL [expected NOTRUN] subtest: unclean ImageBitmap: Setting fillStyle to an origin-unclean pattern makes the canvas origin-unclean

      promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
      

    • PASS [expected NOTRUN] subtest: cross-origin HTMLImageElement: Setting fillStyle to an origin-unclean offscreen canvas pattern makes the canvas origin-unclean
    • FAIL [expected NOTRUN] subtest: cross-origin SVGImageElement: Setting fillStyle to an origin-unclean offscreen canvas pattern makes the canvas origin-unclean

      promise_test: Unhandled rejection with value: object "[object Event]"
      

    • TIMEOUT [expected NOTRUN] subtest: cross-origin HTMLVideoElement: Setting fillStyle to an origin-unclean offscreen canvas pattern makes the canvas origin-unclean

      Test timed out
      

  • OK /html/semantics/embedded-content/the-video-element/intrinsic_sizes.htm (#34434)
    • FAIL [expected PASS] subtest: default object size after src is removed

      assert_equals: expected "320px" but got "300px"
      

  • OK /html/semantics/forms/form-submission-0/urlencoded2.window.html (#28687)
    • PASS [expected FAIL] subtest: application/x-www-form-urlencoded: characters not in encoding in name and value (normal form)
  • OK /navigation-timing/test-navigation-type-reload.html (#33334)
    • PASS [expected FAIL] subtest: Reload domComplete > Original domComplete
    • PASS [expected FAIL] subtest: Reload domContentLoadedEventEnd > Original domContentLoadedEventEnd
    • PASS [expected FAIL] subtest: Reload domContentLoadedEventStart > Original domContentLoadedEventStart
    • PASS [expected FAIL] subtest: Reload domInteractive > Original domInteractive
    • PASS [expected FAIL] subtest: Reload fetchStart > Original fetchStart
  • OK [expected TIMEOUT] /performance-timeline/navigation-id-detached-frame.tentative.html (#34773)
    • PASS [expected TIMEOUT] subtest: The navigation_id getter does not crash a window of detached frame
  • OK /webaudio/the-audio-api/the-audiobuffersourcenode-interface/sub-sample-buffer-stitching.html (#22849)
    • FAIL [expected PASS] subtest: X Stitched sine-wave buffers at sample rate 43800 does not equal [0,0.06264832615852356,0.12505052983760834,0.18696144223213196,0.24813786149024963,0.308339387178421,0.36732959747314453,0.4248766601085663,0.480754554271698,0.5347436666488647,0.5866320133209229,0.6362156271934509,0.6832997798919678,0.7276994585990906,0.7692402601242065,0.8077589869499207...] with an element-wise tolerance of {"absoluteThreshold":0.0038986,"relativeThreshold":0}. Index Actual Expected AbsError RelError Test threshold [14650] 1.5940468346339887e-12 8.6956524848937988e-1 8.6956524848778582e-1 9.9999999999816680e-1 3.8985999999999999e-3 [14651] 3.0547976493835449e-1 8.9879405498504639e-1 5.9331429004669189e-1 6.6012262403823208e-1 3.8985999999999999e-3 Max AbsError of 8.6956524848778582e-1 at index of 14650. Max RelError of 9.9999999999816680e-1 at index of 14650.

      assert_true: expected true got false
      

    • FAIL [expected PASS] subtest: X SNR (42.965252880055054 dB) is not greater than or equal to 65.737. Got 42.965252880055054.

      assert_true: expected true got false
      

Stable unexpected results (187)
  • FAIL [expected PASS] /_mozilla/css/inline_block_parent_padding_a.html
  • FAIL [expected PASS] /_mozilla/css/inline_margins_a.html
  • FAIL [expected PASS] /_mozilla/css/letter_spacing_a.html
  • FAIL [expected PASS] /_mozilla/css/octicons_a.html
  • FAIL [expected PASS] /_mozilla/css/table_specified_width_a.html
  • FAIL [expected PASS] /_mozilla/css/text_align_justify_a.html
  • FAIL [expected PASS] /_mozilla/css/text_indent_a.html
  • FAIL [expected PASS] /_mozilla/css/text_node_opacity.html
  • FAIL [expected PASS] /_mozilla/css/text_shadow_simple_a.html
  • FAIL [expected PASS] /_mozilla/css/vertical_align_bottom_a.html
  • FAIL [expected PASS] /_mozilla/css/vertical_align_sub_a.html
  • FAIL [expected PASS] /_mozilla/css/vertical_align_super_a.html
  • FAIL [expected PASS] /_mozilla/css/vertical_align_text_bottom_a.html
  • FAIL [expected PASS] /_mozilla/css/vertical_align_text_top_a.html
  • FAIL [expected PASS] /_mozilla/css/vertical_align_top_a.html
  • FAIL [expected PASS] /_mozilla/css/vertical_align_top_bottom_a.html
  • FAIL [expected PASS] /_mozilla/css/vertical_align_top_span_a.html
  • FAIL [expected PASS] /_mozilla/css/word-spacing.html
  • TIMEOUT [expected OK] /_mozilla/mozilla/mime_sniffing_font_context.html
    • TIMEOUT [expected PASS] subtest: Sniffed font is loaded and applied

      Test timed out
      

    • TIMEOUT [expected PASS] subtest: Sniffed font with xml is not loaded

      Test timed out
      

    • TIMEOUT [expected PASS] subtest: Sniffed font with xhtml+xml is not loaded

      Test timed out
      

  • FAIL [expected PASS] /css/CSS2/visudet/content-height-004.html
  • FAIL [expected PASS] /css/CSS2/visudet/content-height-005.html
  • FAIL [expected PASS] /css/CSS2/visudet/line-height-203.html
  • PASS [expected FAIL] /css/CSS2/visudet/line-height-204.html
  • FAIL [expected PASS] /css/CSS2/visudet/line-height-206.html
  • FAIL [expected PASS] /css/WOFF2/blocks-extraneous-data-001.xht
  • FAIL [expected PASS] /css/WOFF2/blocks-extraneous-data-002.xht
  • FAIL [expected PASS] /css/WOFF2/blocks-extraneous-data-003.xht
  • FAIL [expected PASS] /css/WOFF2/blocks-extraneous-data-004.xht
  • FAIL [expected PASS] /css/WOFF2/blocks-extraneous-data-005.xht
  • FAIL [expected PASS] /css/WOFF2/blocks-extraneous-data-006.xht
  • FAIL [expected PASS] /css/WOFF2/blocks-extraneous-data-007.xht
  • FAIL [expected PASS] /css/WOFF2/blocks-extraneous-data-008.xht
  • FAIL [expected PASS] /css/WOFF2/blocks-overlap-001.xht
  • FAIL [expected PASS] /css/WOFF2/blocks-overlap-002.xht
  • FAIL [expected PASS] /css/WOFF2/blocks-overlap-003.xht
  • PASS [expected FAIL] /css/WOFF2/datatypes-alt-255uint16-001.xht
  • FAIL [expected PASS] /css/WOFF2/datatypes-invalid-base128-001.xht
  • FAIL [expected PASS] /css/WOFF2/datatypes-invalid-base128-002.xht
  • FAIL [expected PASS] /css/WOFF2/datatypes-invalid-base128-003.xht
  • PASS [expected FAIL] /css/WOFF2/directory-knowntags-001.xht
  • FAIL [expected PASS] /css/WOFF2/directory-mismatched-tables-001.xht
  • FAIL [expected PASS] /css/WOFF2/header-length-001.xht
  • FAIL [expected PASS] /css/WOFF2/header-length-002.xht
  • FAIL [expected PASS] /css/WOFF2/header-numTables-001.xht
  • FAIL [expected PASS] /css/WOFF2/header-signature-001.xht
  • PASS [expected FAIL] /css/WOFF2/header-totalsfntsize-001.xht
  • FAIL [expected PASS] /css/WOFF2/tabledata-bad-origlength-loca-001.xht
  • FAIL [expected PASS] /css/WOFF2/tabledata-bad-origlength-loca-002.xht
  • FAIL [expected PASS] /css/WOFF2/tabledata-brotli-001.xht
  • FAIL [expected PASS] /css/WOFF2/tabledata-decompressed-length-001.xht
  • FAIL [expected PASS] /css/WOFF2/tabledata-decompressed-length-002.xht
  • FAIL [expected PASS] /css/WOFF2/tabledata-decompressed-length-003.xht
  • FAIL [expected PASS] /css/WOFF2/tabledata-decompressed-length-004.xht
  • FAIL [expected PASS] /css/WOFF2/tabledata-extraneous-data-001.xht
  • PASS [expected FAIL] /css/WOFF2/tabledata-glyf-bbox-001.xht
  • FAIL [expected PASS] /css/WOFF2/tabledata-glyf-bbox-002.xht
  • FAIL [expected PASS] /css/WOFF2/tabledata-glyf-bbox-003.xht
  • PASS [expected FAIL] /css/WOFF2/tabledata-glyf-origlength-001.xht
  • PASS [expected FAIL] /css/WOFF2/tabledata-glyf-origlength-002.xht
  • PASS [expected FAIL] /css/WOFF2/tabledata-glyf-origlength-003.xht
  • FAIL [expected PASS] /css/WOFF2/tabledata-non-zero-loca-001.xht
  • FAIL [expected PASS] /css/WOFF2/tabledata-transform-bad-flag-001.xht
  • FAIL [expected PASS] /css/WOFF2/tabledata-transform-bad-flag-002.xht
  • PASS [expected FAIL] /css/WOFF2/tabledata-transform-hmtx-001.xht
  • PASS [expected FAIL] /css/WOFF2/tabledata-transform-hmtx-002.xht
  • FAIL [expected PASS] /css/WOFF2/tabledata-transform-hmtx-003.xht
  • FAIL [expected PASS] /css/WOFF2/tabledata-transform-hmtx-004.xht
  • PASS [expected FAIL] /css/WOFF2/valid-005.xht
  • PASS [expected FAIL] /css/WOFF2/valid-006.xht
  • PASS [expected FAIL] /css/WOFF2/valid-007.xht
  • PASS [expected FAIL] /css/WOFF2/valid-008.xht
  • FAIL [expected PASS] /css/css-fonts/alternates-order.html
  • FAIL [expected PASS] /css/css-fonts/first-available-font-002.html
  • FAIL [expected PASS] /css/css-fonts/font-colorization.html
  • FAIL [expected PASS] /css/css-fonts/font-default-01.html
  • FAIL [expected PASS] /css/css-fonts/font-default-02.html
  • FAIL [expected PASS] /css/css-fonts/font-face-stretch-auto-variable.html
  • FAIL [expected PASS] /css/css-fonts/font-face-stretch-default-variable.html
  • FAIL [expected PASS] /css/css-fonts/font-face-style-auto-variable.html
  • FAIL [expected PASS] /css/css-fonts/font-face-style-default-variable.html
  • FAIL [expected PASS] /css/css-fonts/font-face-weight-auto-variable.html
  • FAIL [expected PASS] /css/css-fonts/font-face-weight-default-variable.html
  • FAIL [expected PASS] /css/css-fonts/font-kerning-02.html
  • FAIL [expected PASS] /css/css-fonts/font-stretch-07.html
  • FAIL [expected PASS] /css/css-fonts/font-stretch-08.html
  • FAIL [expected PASS] /css/css-fonts/font-stretch-09.html
  • FAIL [expected PASS] /css/css-fonts/font-stretch-10.html
  • FAIL [expected PASS] /css/css-fonts/font-stretch-11.html
  • FAIL [expected PASS] /css/css-fonts/font-stretch-12.html
  • FAIL [expected PASS] /css/css-fonts/font-stretch-17.html
  • FAIL [expected PASS] /css/css-fonts/font-stretch-18.html
  • FAIL [expected PASS] /css/css-fonts/font-synthesis-08.html
  • FAIL [expected PASS] /css/css-fonts/font-variant-alternates-01.html
  • FAIL [expected PASS] /css/css-fonts/font-variant-caps-01.html
  • FAIL [expected PASS] /css/css-fonts/font-variant-east-asian-01.html
  • FAIL [expected PASS] /css/css-fonts/font-variant-ligatures-01.html
  • FAIL [expected PASS] /css/css-fonts/font-variant-ligatures-03.html
  • FAIL [expected PASS] /css/css-fonts/font-variant-ligatures-06.html
  • FAIL [expected PASS] /css/css-fonts/font-variant-ligatures-08.html
  • FAIL [expected PASS] /css/css-fonts/font-variant-ligatures-09.html
  • FAIL [expected PASS] /css/css-fonts/font-variant-numeric-01.html
  • FAIL [expected PASS] /css/css-fonts/font-variant-position-01.html
  • FAIL [expected PASS] /css/css-fonts/italic-oblique-fallback.html
  • FAIL [expected PASS] /css/css-fonts/system-ui-ar.html
  • FAIL [expected PASS] /css/css-fonts/system-ui-ur.html
  • PASS [expected FAIL] /css/css-fonts/variation-sequences.html
  • TIMEOUT [expected OK] /css/css-fonts/variations/font-opentype-collections.html
    • NOTRUN [expected PASS] subtest: Verify that collection font is loaded
  • FAIL [expected PASS] /css/css-fonts/variations/font-slant-1.html
  • FAIL [expected PASS] /css/css-fonts/variations/font-slant-2a.html
  • FAIL [expected PASS] /css/css-fonts/variations/font-slant-2b.html
  • FAIL [expected PASS] /css/css-fonts/variations/font-slant-2c.html
  • OK /css/css-fonts/variations/font-weight-matching.html
    • FAIL [expected PASS] subtest: Test @font-face matching for weight 99

      assert_approx_equals: @font-face should be mapped to CSSTest Weights 900. expected 90 +/- 2 but got 87
      

    • FAIL [expected PASS] subtest: Test @font-face matching for weight 100

      assert_approx_equals: @font-face should be mapped to CSSTest Weights 900. expected 90 +/- 2 but got 87
      

    • FAIL [expected PASS] subtest: Test @font-face matching for weight 249

      assert_approx_equals: @font-face should be mapped to CSSTest Weights 900. expected 90 +/- 2 but got 87
      

    • FAIL [expected PASS] subtest: Test @font-face matching for weight 250

      assert_approx_equals: @font-face should be mapped to CSSTest Weights 800. expected 90 +/- 2 but got 87
      

    • FAIL [expected PASS] subtest: Test @font-face matching for weight 399

      assert_approx_equals: @font-face should be mapped to CSSTest Weights 800. expected 90 +/- 2 but got 87
      

    • FAIL [expected PASS] subtest: Test @font-face matching for weight 400

      assert_approx_equals: @font-face should be mapped to CSSTest Weights 700. expected 90 +/- 2 but got 87
      

    • FAIL [expected PASS] subtest: Test @font-face matching for weight 420

      assert_approx_equals: @font-face should be mapped to CSSTest Weights 600. expected 90 +/- 2 but got 87
      

    • FAIL [expected PASS] subtest: Test @font-face matching for weight 470

      assert_approx_equals: @font-face should be mapped to CSSTest Weights 300. expected 90 +/- 2 but got 87
      

    • FAIL [expected PASS] subtest: Test @font-face matching for weight 500

      assert_approx_equals: @font-face should be mapped to CSSTest Weights 300. expected 90 +/- 2 but got 87
      

    • FAIL [expected PASS] subtest: Test @font-face matching for weight 600

      assert_approx_equals: @font-face should be mapped to CSSTest Weights 200. expected 90 +/- 2 but got 95
      

    • And 4 more unexpected results...
  • PASS [expected FAIL] /css/css-fonts/variations/font-weight-metrics.html
  • FAIL [expected PASS] /css/css-fonts/variations/slnt-backslant-variable.html
  • FAIL [expected PASS] /css/css-fonts/variations/slnt-variable.html
  • PASS [expected FAIL] /css/css-text-decor/text-decoration-thickness-fixed.html
  • FAIL [expected PASS] /css/css-text/line-break/line-break-normal-015b.xht
  • FAIL [expected PASS] /css/css-text/line-break/line-break-strict-015b.xht
  • FAIL [expected PASS] /css/css-text/shaping/reference/shaping-023-ref.html
  • PASS [expected FAIL] /css/css-text/shaping/shaping-012.html
  • PASS [expected FAIL] /css/css-text/shaping/shaping-013.html
  • PASS [expected FAIL] /css/css-text/shaping/shaping-023.html
  • PASS [expected FAIL] /css/css-text/shaping/shaping-024.html
  • PASS [expected FAIL] /css/css-text/shaping/shaping-025.html
  • FAIL [expected PASS] /css/css-text/shaping/shaping_lig-001.html
  • FAIL [expected PASS] /css/css-values/ch-unit-016.html
  • FAIL [expected PASS] /css/css-values/ex-unit-001.html
  • FAIL [expected PASS] /css/css-values/ex-unit-002.html
  • FAIL [expected PASS] /css/css-values/ex-unit-003.html
  • FAIL [expected PASS] /css/css-values/ic-unit-013.html
  • FAIL [expected PASS] /css/css-values/ic-unit-014.html
  • TIMEOUT [expected PASS] /html/canvas/element/manual/text/canvas.2d.lang.dynamic.html
  • TIMEOUT [expected PASS] /html/canvas/element/manual/text/canvas.2d.lang.empty.canvas.html
  • TIMEOUT [expected PASS] /html/canvas/element/manual/text/canvas.2d.lang.html
  • TIMEOUT [expected PASS] /html/canvas/element/manual/text/canvas.2d.lang.inherit.disconnected.canvas.html
  • TIMEOUT [expected PASS] /html/canvas/element/manual/text/canvas.2d.lang.inherit.disconnected.canvas.no.lang.html
  • TIMEOUT [expected PASS] /html/canvas/element/manual/text/canvas.2d.lang.inherit.html
  • TIMEOUT [expected FAIL] /html/canvas/offscreen/manual/text/canvas.2d.offscreen.transferred.lang.html
  • TIMEOUT [expected FAIL] /html/canvas/offscreen/manual/text/canvas.2d.offscreen.transferred.lang.inherit.document.html
  • TIMEOUT [expected FAIL] /html/canvas/offscreen/manual/text/canvas.2d.offscreen.transferred.lang.inherit.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.draw.align.center.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.draw.align.end.rtl.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.draw.align.left.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.draw.align.right.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.draw.align.start.ltr.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.draw.baseline.alphabetic.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.draw.baseline.bottom.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.draw.baseline.hanging.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.draw.baseline.ideographic.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.draw.baseline.middle.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.draw.baseline.top.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.bound.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.draw.fontface.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.draw.fontface.notinpage.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.draw.fontface.repeat.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.draw.space.basic.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.draw.space.collapse.end.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.draw.space.collapse.nonspace.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.draw.space.collapse.other.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.draw.space.collapse.space.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.draw.space.collapse.start.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.measure.actualBoundingBox.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.measure.actualBoundingBox.whitespace.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.measure.baselines.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.measure.fillTextCluster-options.tentative.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.measure.getActualBoundingBox.tentative.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.measure.index-from-offset-edge-cases.tentative.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.measure.strokeTextCluster-options.tentative.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.measure.strokeTextCluster-range.tentative.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.measure.text-clusters-position.tentative.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.measure.width.basic.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.measure.width.empty.html
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.measure.width.space.html
  • PASS [expected FAIL] /html/canvas/offscreen/text/canvas.2d.fontStretch.condensed.html
  • PASS [expected FAIL] /html/canvas/offscreen/text/canvas.2d.fontStretch.expanded.html
  • PASS [expected FAIL] /html/canvas/offscreen/text/canvas.2d.fontStretch.extra-condensed.html
  • PASS [expected FAIL] /html/canvas/offscreen/text/canvas.2d.fontStretch.extra-expanded.html
  • PASS [expected FAIL] /html/canvas/offscreen/text/canvas.2d.fontStretch.normal.html
  • PASS [expected FAIL] /html/canvas/offscreen/text/canvas.2d.fontStretch.semi-condensed.html
  • PASS [expected FAIL] /html/canvas/offscreen/text/canvas.2d.fontStretch.semi-expanded.html
  • PASS [expected FAIL] /html/canvas/offscreen/text/canvas.2d.fontStretch.ultra-condensed.html
  • PASS [expected FAIL] /html/canvas/offscreen/text/canvas.2d.fontStretch.ultra-expanded.html

@github-actions

Copy link
Copy Markdown

⚠️ Try run (#15062622412) failed.

@jdm

jdm commented May 16, 2025

Copy link
Copy Markdown
Member

Oof! We're going to need to figure out what's now going wrong with font loads that are supposed to work.

Comment thread components/fonts/font_context.rs Resolved
Comment on lines +832 to +833
.credentials_mode(CredentialsMode::CredentialsSameOrigin)
.service_workers_mode(ServiceWorkersMode::All)

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.

If these are the default values, maybe they don't need to be set explicitly here?

Comment thread components/script/dom/fontface.rs Outdated
)
.expect("Parsing shouldn't fail as descriptors are valid by construction");

//Construct a WebFontDocumentContext object for the current document.

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.

Nit:

Suggested change
//Construct a WebFontDocumentContext object for the current document.
// Construct a WebFontDocumentContext object for the current document.

Comment thread components/script/dom/fontface.rs Outdated
Comment on lines +547 to +552
let document_context = WebFontDocumentContext {
policy_container: global.policy_container(),
document_url: global.api_base_url(),
has_trustworthy_ancestor_origin: global.has_trustworthy_ancestor_origin(),
insecure_requests_policy: global.insecure_requests_policy(),
};

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.

Since this struct is only applicable on Window currently, perhaps it would be useful to create a helper in Window which makes this data structure.

Comment thread components/script/dom/window.rs Outdated
Comment on lines +2173 to +2179
//Construct a new document context for the reflow.
let document_context = WebFontDocumentContext {
policy_container: self.global().policy_container(),
document_url: self.global().api_base_url(),
has_trustworthy_ancestor_origin: self.global().has_trustworthy_ancestor_origin(),
insecure_requests_policy: self.global().insecure_requests_policy(),
};

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.

The helper could be used here as well.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thank you for the recommendations

github-merge-queue Bot pushed a commit that referenced this pull request May 27, 2025
#37021 exposed that our tests are trying to load a local file path for
Ahem.ttf, but this stops working when we implement the specified CORS
protections for our font requests. Luckily, the WPT suite already
provides a same-origin version of the same font, so we can just update
our CSS to use that font face instead.

Testing: Existing WPT coverage.

Signed-off-by: Josh Matthews <[email protected]>
Signed-off-by: Uthman Yahaya Baba <[email protected]>
@jdm jdm added the T-linux-wpt Do a try run of the WPT label Jun 1, 2025
@github-actions github-actions Bot removed the T-linux-wpt Do a try run of the WPT label Jun 1, 2025
@github-actions

github-actions Bot commented Jun 1, 2025

Copy link
Copy Markdown

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

@github-actions

github-actions Bot commented Jun 1, 2025

Copy link
Copy Markdown

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

Flaky unexpected result (25)
  • OK /content-security-policy/frame-ancestors/frame-ancestors-path-ignored.window.html (#36468)
    • PASS [expected FAIL] subtest: A 'frame-ancestors' CSP directive with a URL that includes a path should be ignored.
  • OK /css/css-align/blocks/align-content-block-002.html
    • FAIL [expected PASS] subtest: .test 1: start

      assert_equals: 
      &lt;div class="test" style="align-content: start" title="start"&gt;
          &lt;div class="in-flow" data-offset-y="15"&gt;&lt;/div&gt;
          &lt;div class="in-flow"&gt;
            &lt;span class="label"&gt;START&lt;/span&gt;
            &lt;span class="abspos" data-offset-y="0"&gt;ABS&lt;/span&gt;
            &lt;span class="relpos" data-offset-y="0"&gt;REL&lt;/span&gt;
            &lt;div class="overflow"&gt;OVERFLOW&lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      offsetTop expected 0 but got -1
      

    • FAIL [expected PASS] subtest: .test 4: baseline

      assert_equals: 
      &lt;div class="test" style="align-content: baseline" title="baseline"&gt;
          &lt;div class="in-flow" data-offset-y="15"&gt;&lt;/div&gt;
          &lt;div class="in-flow"&gt;
            &lt;span class="label"&gt;BASELINE&lt;/span&gt;
            &lt;span class="abspos" data-offset-y="0"&gt;ABS&lt;/span&gt;
            &lt;span class="relpos" data-offset-y="0"&gt;REL&lt;/span&gt;
            &lt;div class="overflow"&gt;OVERFLOW&lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      offsetTop expected 0 but got -1
      

    • FAIL [expected PASS] subtest: .test 6: flex-start

      assert_equals: 
      &lt;div class="test" style="align-content: flex-start" title="flex-start"&gt;
          &lt;div class="in-flow" data-offset-y="15"&gt;&lt;/div&gt;
          &lt;div class="in-flow"&gt;
            &lt;span class="label"&gt;FLEX-START&lt;/span&gt;
            &lt;span class="abspos" data-offset-y="0"&gt;ABS&lt;/span&gt;
            &lt;span class="relpos" data-offset-y="0"&gt;REL&lt;/span&gt;
            &lt;div class="overflow"&gt;OVERFLOW&lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      offsetTop expected 0 but got -1
      

    • FAIL [expected PASS] subtest: .test 8: unsafe start

      assert_equals: 
      &lt;div class="test" style="align-content: unsafe start" title="unsafe start"&gt;
          &lt;div class="in-flow" data-offset-y="15"&gt;&lt;/div&gt;
          &lt;div class="in-flow"&gt;
            &lt;span class="label"&gt;UNSAFE START&lt;/span&gt;
            &lt;span class="abspos" data-offset-y="0"&gt;ABS&lt;/span&gt;
            &lt;span class="relpos" data-offset-y="0"&gt;REL&lt;/span&gt;
            &lt;div class="overflow"&gt;OVERFLOW&lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      offsetTop expected 0 but got -1
      

    • FAIL [expected PASS] subtest: .test 11: safe start

      assert_equals: 
      &lt;div class="test" style="align-content: safe start" title="safe start"&gt;
          &lt;div class="in-flow" data-offset-y="15"&gt;&lt;/div&gt;
          &lt;div class="in-flow"&gt;
            &lt;span class="label"&gt;SAFE START&lt;/span&gt;
            &lt;span class="abspos" data-offset-y="0"&gt;ABS&lt;/span&gt;
            &lt;span class="relpos" data-offset-y="0"&gt;REL&lt;/span&gt;
            &lt;div class="overflow"&gt;OVERFLOW&lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      offsetTop expected 0 but got -1
      

    • FAIL [expected PASS] subtest: .test 15: space-between

      assert_equals: 
      &lt;div class="test" style="align-content: space-between" title="space-between"&gt;
          &lt;div class="in-flow" data-offset-y="15"&gt;&lt;/div&gt;
          &lt;div class="in-flow"&gt;
            &lt;span class="label"&gt;SPACE-BETWEEN&lt;/span&gt;
            &lt;span class="abspos" data-offset-y="0"&gt;ABS&lt;/span&gt;
            &lt;span class="relpos" data-offset-y="0"&gt;REL&lt;/span&gt;
            &lt;div class="overflow"&gt;OVERFLOW&lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      offsetTop expected 0 but got -1
      

    • FAIL [expected PASS] subtest: .test 17: normal

      assert_equals: 
      &lt;div class="test" style="align-content: normal" title="normal"&gt;
          &lt;div class="in-flow" data-offset-y="10"&gt;&lt;/div&gt;
          &lt;div class="in-flow"&gt;
            &lt;span class="label"&gt;NORMAL&lt;/span&gt;
            &lt;span class="abspos" data-offset-y="-5"&gt;ABS&lt;/span&gt;
            &lt;span class="relpos" data-offset-y="-5"&gt;REL&lt;/span&gt;
            &lt;div class="overflow"&gt;OVERFLOW&lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      offsetTop expected -5 but got -6
      

  • PASS [expected FAIL] /css/css-grid/grid-items/grid-auto-margin-and-replaced-item-001.html (#37162)
  • FAIL [expected PASS] /css/css-tables/table-cell-overflow-auto-scrolled.html (#35011)
  • OK [expected ERROR] /fetch/fetch-later/quota/same-origin-iframe/multiple-iframes.tentative.https.window.html (#35176)
  • ERROR /fetch/metadata/generated/serviceworker.https.sub.html (#36247)
    • PASS [expected FAIL] subtest: sec-fetch-site - Same origin, no options - registration
  • OK /html/browsers/browsing-the-web/navigating-across-documents/empty-iframe-load-event.html (#29066)
    • FAIL [expected PASS] subtest: Check execution order from nested timeout

      assert_equals: Expected nested setTimeout to run second expected true but got false
      

    • FAIL [expected PASS] subtest: Check execution order on load handler

      assert_equals: Expected onload to run first expected false but got true
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/javascript-url-return-value-handling-dynamic.html (#28066)
    • FAIL [expected PASS] subtest: 0041 set in href="" targeting a frame and clicked

      assert_equals: expected "A" but got ""
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-cross-origin.sub.window.html (#29056)
    • PASS [expected FAIL] subtest: Cross-origin navigation started from unload handler must be ignored
  • TIMEOUT [expected OK] /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-requestsubmit.html (#28716)
    • TIMEOUT [expected FAIL] subtest: Replace before load, triggered by formElement.requestSubmit()

      Test timed out
      

  • OK /html/browsers/history/the-history-interface/traverse_the_history_2.html (#21383)
    • PASS [expected FAIL] subtest: Multiple history traversals, last would be aborted
  • TIMEOUT [expected ERROR] /html/canvas/element/manual/imagebitmap/createImageBitmap-colorSpaceConversion.html (#34151)
  • PASS [expected FAIL] /html/canvas/element/manual/text/canvas.2d.disconnected.html (#30063)
  • CRASH [expected OK] /html/canvas/element/manual/wide-gamut-canvas/canvas-display-p3-drawImage.https.html
  • TIMEOUT [expected OK] /html/infrastructure/urls/base-url/document-base-url-window-initiator-is-not-opener.https.window.html (#30970)
  • TIMEOUT [expected OK] /html/interaction/focus/the-autofocus-attribute/document-with-fragment-empty.html (#28259)
    • TIMEOUT [expected FAIL] subtest: Autofocus elements in top-level browsing context's documents with empty fragments should work.

      Test timed out
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/playing-the-media-resource/loop-from-ended.tentative.html (#33778)
    • FAIL [expected TIMEOUT] subtest: play() with loop set to true after playback ended

      this argument is not a finite floating-point value
      

  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-canvas-element/security.pattern.fillStyle.sub.html (#36989)
    • TIMEOUT [expected FAIL] subtest: redirected to same-origin HTMLVideoElement: Setting fillStyle to an origin-unclean pattern makes the canvas origin-unclean

      Test timed out
      

    • NOTRUN [expected PASS] subtest: unclean HTMLCanvasElement: Setting fillStyle to an origin-unclean pattern makes the canvas origin-unclean
    • NOTRUN [expected FAIL] subtest: unclean ImageBitmap: Setting fillStyle to an origin-unclean pattern makes the canvas origin-unclean
    • NOTRUN [expected PASS] subtest: cross-origin HTMLImageElement: Setting fillStyle to an origin-unclean offscreen canvas pattern makes the canvas origin-unclean
    • NOTRUN [expected FAIL] subtest: cross-origin SVGImageElement: Setting fillStyle to an origin-unclean offscreen canvas pattern makes the canvas origin-unclean
    • NOTRUN [expected FAIL] subtest: cross-origin HTMLVideoElement: Setting fillStyle to an origin-unclean offscreen canvas pattern makes the canvas origin-unclean
    • NOTRUN [expected FAIL] subtest: redirected to cross-origin HTMLVideoElement: Setting fillStyle to an origin-unclean offscreen canvas pattern makes the canvas origin-unclean
    • NOTRUN [expected FAIL] subtest: redirected to same-origin HTMLVideoElement: Setting fillStyle to an origin-unclean offscreen canvas pattern makes the canvas origin-unclean
    • NOTRUN [expected PASS] subtest: unclean HTMLCanvasElement: Setting fillStyle to an origin-unclean offscreen canvas pattern makes the canvas origin-unclean
    • NOTRUN [expected FAIL] subtest: unclean ImageBitmap: Setting fillStyle to an origin-unclean offscreen canvas pattern makes the canvas origin-unclean
  • OK [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-3.html (#24057)
    • FAIL [expected TIMEOUT] subtest: Check that popups from a sandboxed iframe escape the sandbox if allow-popups-to-escape-sandbox is used

      assert_equals: It came from a sandboxed iframe expected "null" but got "http://web-platform.test:8000"
      

  • OK /html/semantics/embedded-content/the-video-element/intrinsic_sizes.htm (#37173)
    • FAIL [expected PASS] subtest: default object size after src is removed

      assert_equals: expected "300px" but got "320px"
      

  • OK /html/semantics/scripting-1/the-script-element/module/dynamic-import/blob-url.any.worker.html (#33909)
    • FAIL [expected PASS] subtest: Revoking a blob URL immediately after calling import will not fail

      promise_test: Unhandled rejection with value: object "TypeError: Dynamic import failed"
      

  • OK [expected TIMEOUT] /performance-timeline/navigation-id-detached-frame.tentative.html (#34773)
    • PASS [expected TIMEOUT] subtest: The navigation_id getter does not crash a window of detached frame
  • TIMEOUT /preload/preload-resource-match.https.html
    • TIMEOUT [expected FAIL] subtest: Loading script (use-credentials) with link (no-cors) should discard the preloaded response

      Test timed out
      

    • NOTRUN [expected TIMEOUT] subtest: Loading script (use-credentials) with link (anonymous) should discard the preloaded response
  • TIMEOUT [expected OK] /webmessaging/without-ports/018.html (#24485)
    • TIMEOUT [expected PASS] subtest: origin of the script that invoked the method, javascript:

      Test timed out
      

  • ERROR [expected OK] /workers/constructors/Worker/Worker-constructor.html (#22991)
Stable unexpected results that are known to be intermittent (23)
  • OK /FileAPI/url/url-with-fetch.any.worker.html (#21517)
    • PASS [expected FAIL] subtest: Revoke blob URL after calling fetch, fetch should succeed
  • FAIL [expected PASS] /_mozilla/mozilla/sslfail.html (#10760)
  • OK /css/css-fonts/variations/at-font-face-font-matching.html (#20684)
    • FAIL [expected PASS] subtest: Matching font-weight: '430' should prefer '450 460' over '500'

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

  • OK /css/css-grid/alignment/grid-content-alignment-with-abspos-001.html (#34339)
    • PASS [expected FAIL] subtest: .grid 1
  • PASS [expected FAIL] /css/css-overflow/overflow-video.html (#34720)
  • OK /fetch/metadata/generated/css-font-face.https.sub.tentative.html (#32732)
    • PASS [expected FAIL] subtest: sec-fetch-site - Same origin
    • PASS [expected FAIL] subtest: sec-fetch-mode
    • PASS [expected FAIL] subtest: sec-fetch-dest
    • PASS [expected FAIL] subtest: sec-fetch-storage-access - Same site
  • TIMEOUT /fetch/metadata/redirect/multiple-redirect-https-downgrade-upgrade.sub.html (#27251)
    • PASS [expected TIMEOUT] subtest: Https downgrade-upgrade preload
  • OK [expected ERROR] /fetch/nosniff/importscripts.html (#27144)
    • PASS [expected TIMEOUT] subtest: Test importScripts()
  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-nosrc.html (#34819)
    • FAIL [expected PASS] subtest: form submission

      assert_equals: expected "http://web-platform.test:8000/common/blank.html?1=" but got "about:blank"
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-click.html (#28697)
    • FAIL [expected PASS] subtest: aElement.click() before the load event must NOT replace

      assert_equals: expected "http://web-platform.test:8000/common/blank.html?thereplacement" but got "http://web-platform.test:8000/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/resources/code-injector.html?pipe=sub(none)&amp;code=%0A%20%20%20%20const%20a%20%3D%20document.createElement(%22a%22)%3B%0A%20%20%20%20a.href%20%3D%20%22%2Fcommon%2Fblank.html%3Fthereplacement%22%3B%0A%20%20%20%20document.currentScript.before(a)%3B%0A%20%20%20%20a.click()%3B%0A%20%20"
      

  • TIMEOUT [expected OK] /html/browsers/history/the-history-interface/001.html (#12580)
  • OK /html/browsers/history/the-history-interface/traverse_the_history_3.html (#21383)
    • FAIL [expected PASS] subtest: Multiple history traversals, last would be aborted

      assert_array_equals: Pages opened during history navigation expected property 1 to be 3 but got 2 (expected array [6, 3] got [6, 2])
      

  • OK /html/browsers/history/the-history-interface/traverse_the_history_4.html (#21383)
    • FAIL [expected PASS] subtest: Multiple history traversals, last would be aborted

      assert_array_equals: Pages opened during history navigation expected property 1 to be 5 but got 3 (expected array [6, 5] got [6, 3])
      

  • TIMEOUT /html/canvas/element/manual/imagebitmap/createImageBitmap-origin.sub.html (#31931)
    • TIMEOUT [expected FAIL] subtest: cross-origin HTMLVideoElement: origin unclear 2dContext.drawImage

      Test timed out
      

    • NOTRUN [expected FAIL] subtest: cross-origin HTMLVideoElement: origin unclear bitmaprenderer.transferFromImageBitmap
    • NOTRUN [expected FAIL] subtest: redirected to cross-origin HTMLVideoElement: origin unclear getImageData
    • NOTRUN [expected FAIL] subtest: redirected to cross-origin HTMLVideoElement: origin unclear 2dContext.drawImage
    • NOTRUN [expected FAIL] subtest: redirected to cross-origin HTMLVideoElement: origin unclear bitmaprenderer.transferFromImageBitmap
    • NOTRUN [expected FAIL] subtest: redirected to same-origin HTMLVideoElement: origin unclear getImageData
    • NOTRUN [expected FAIL] subtest: redirected to same-origin HTMLVideoElement: origin unclear 2dContext.drawImage
    • NOTRUN [expected FAIL] subtest: redirected to same-origin HTMLVideoElement: origin unclear bitmaprenderer.transferFromImageBitmap
    • NOTRUN [expected FAIL] subtest: unclean HTMLCanvasElement: origin unclear getImageData
    • NOTRUN [expected FAIL] subtest: unclean HTMLCanvasElement: origin unclear 2dContext.drawImage
    • And 4 more unexpected results...
  • TIMEOUT /html/interaction/focus/the-autofocus-attribute/supported-elements.html (#24145)
    • TIMEOUT [expected FAIL] subtest: Contenteditable element should support autofocus

      Test timed out
      

    • NOTRUN [expected FAIL] subtest: Element with tabindex should support autofocus
    • NOTRUN [expected PASS] subtest: Non-HTMLElement should not support autofocus
  • OK [expected CRASH] /html/semantics/embedded-content/media-elements/media_fragment_seek.html (#24114)
  • OK [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html (#22154)
    • FAIL [expected NOTRUN] subtest: Check that popups from a sandboxed iframe do not escape the sandbox

      assert_equals: It came from a sandboxed iframe expected "null" but got "http://web-platform.test:8000"
      

  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-3.html (#24066)
    • NOTRUN [expected FAIL] subtest: Check that popups from a sandboxed iframe do not escape the sandbox
  • TIMEOUT [expected OK] /html/semantics/forms/form-submission-0/reparent-form-during-planned-navigation-task.html (#29724)
    • TIMEOUT [expected PASS] subtest: reparent-form-during-planned-navigation-task

      Test timed out
      

  • OK /navigation-timing/test-navigation-type-reload.html (#33334)
    • PASS [expected FAIL] subtest: Reload domContentLoadedEventStart &gt; Original domContentLoadedEventStart
    • PASS [expected FAIL] subtest: Reload domInteractive &gt; Original domInteractive
    • PASS [expected FAIL] subtest: Reload fetchStart &gt; Original fetchStart
  • OK /preload/preload-error.sub.html (#37177)
    • PASS [expected FAIL] subtest: success (style): main
    • PASS [expected FAIL] subtest: 404 (script): main
    • PASS [expected FAIL] subtest: 404 (xhr): main
    • PASS [expected FAIL] subtest: Decode-error (script): main
    • FAIL [expected PASS] subtest: MIME-error (script): main

      assert_greater_than: http://web-platform.test:8000/preload/resources/dummy.css?pipe=header%28Content-Type%2Ctext%2Fnotjavascript%29&amp;label=script should be loaded expected a number greater than 0 but got 0
      

  • OK /resize-observer/change-layout-in-error.html (#32629)
    • FAIL [expected PASS] subtest: Changing layout in window error handler should not result in lifecyle loop when resize observer loop limit is reached.

      assert_equals: expected 1 but got 2
      

  • OK /webaudio/the-audio-api/the-audiobuffersourcenode-interface/sub-sample-buffer-stitching.html (#22849)
    • FAIL [expected PASS] subtest: X Stitched sine-wave buffers at sample rate 43800 does not equal [0,0.06264832615852356,0.12505052983760834,0.18696144223213196,0.24813786149024963,0.308339387178421,0.36732959747314453,0.4248766601085663,0.480754554271698,0.5347436666488647,0.5866320133209229,0.6362156271934509,0.6832997798919678,0.7276994585990906,0.7692402601242065,0.8077589869499207...] with an element-wise tolerance of {"absoluteThreshold":0.0038986,"relativeThreshold":0}. Index Actual Expected AbsError RelError Test threshold [14650] 9.2710790311328486e+33 8.6956524848937988e-1 9.2710790311328486e+33 1.0661740504509223e+34 3.8985999999999999e-3 [14651] 3.0547976493835449e-1 8.9879405498504639e-1 5.9331429004669189e-1 6.6012262403823208e-1 3.8985999999999999e-3 Max AbsError of 9.2710790311328486e+33 at index of 14650. Max RelError of 1.0661740504509223e+34 at index of 14650.

      assert_true: expected true got false
      

    • FAIL [expected PASS] subtest: X SNR (-635.9085197204971 dB) is not greater than or equal to 65.737. Got -635.9085197204971.

      assert_true: expected true got false
      

@github-actions

github-actions Bot commented Jun 1, 2025

Copy link
Copy Markdown

✨ Try run (#15368876501) succeeded.

@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.

Great work! This is almost ready to merge!

Comment on lines +797 to +804
pub fn new_document_context(&self) -> WebFontDocumentContext {
WebFontDocumentContext {
policy_container: self.global().policy_container(),
document_url: self.global().api_base_url(),
has_trustworthy_ancestor_origin: self.global().has_trustworthy_ancestor_origin(),
insecure_requests_policy: self.global().insecure_requests_policy(),
}
}

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.

Suggested change
pub fn new_document_context(&self) -> WebFontDocumentContext {
WebFontDocumentContext {
policy_container: self.global().policy_container(),
document_url: self.global().api_base_url(),
has_trustworthy_ancestor_origin: self.global().has_trustworthy_ancestor_origin(),
insecure_requests_policy: self.global().insecure_requests_policy(),
}
}
pub(crate) fn web_font_context(&self) -> WebFontDocumentContext {
let global = self.upcast::<GlobalScope>();
WebFontDocumentContext {
policy_container: global.policy_container(),
document_url: global.api_base_url(),
has_trustworthy_ancestor_origin: global.has_trustworthy_ancestor_origin(),
insecure_requests_policy: global.insecure_requests_policy(),
}
}

Comment on lines +90 to +91
#[derive(Clone, Debug)]
pub struct WebFontDocumentContext {

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.

Suggested change
#[derive(Clone, Debug)]
pub struct WebFontDocumentContext {
/// Document-specific data required to fetch a web font.
#[derive(Clone, Debug)]
pub struct WebFontDocumentContext {

Comment thread .gitignore

# direnv
.envrc
tests/wpt/web-platform-tests/

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.

Revert this change please!

)
.expect("Parsing shouldn't fail as descriptors are valid by construction");

// Construct a WebFontDocumentContext object for the current document.

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 don't think this comment (and the similar ones in the rest of the PR) give readers any new information. Let's remove them.

github-merge-queue Bot pushed a commit that referenced this pull request Jun 9, 2025
#37021 exposed that our tests are trying to load a local file path for
Ahem.ttf, but this stops working when we implement the specified CORS
protections for our font requests. Luckily, the WPT suite already
provides a same-origin version of the same font, so we can just update
our CSS to use that font face instead.

Testing: Existing WPT coverage.

Signed-off-by: Josh Matthews <[email protected]>
@TimvdLippe

Copy link
Copy Markdown
Contributor

@uthmaniv Thanks for the work up to this point! We would like to continue working on this, as it is a useful addition to our font context loader. Are you planning to continue on this or shall we ask somebody else to do so? Thanks in advance for your reply!

@jdm

jdm commented Oct 31, 2025

Copy link
Copy Markdown
Member

Rebased in #40301.

@jdm jdm closed this Oct 31, 2025
github-merge-queue Bot pushed a commit that referenced this pull request Nov 23, 2025
Rebase of #37021 with review comments applied. These changes bundle up
the required information from the relevant global when a stylesheet is
added so that any requests for web fonts match the specification.

Testing: Newly passing tests.
Fixes: #36590

---------

Signed-off-by: Uthman Yahaya Baba <[email protected]>
Signed-off-by: Josh Matthews <[email protected]>
Co-authored-by: Uthman Yahaya Baba <[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.

Web font requests are missing many settings

5 participants