github web-platform-tests/wpt merge_pr_46629

latest releases: merge_pr_49470, epochs/three_hourly/2024-12-03_06H, epochs/six_hourly/2024-12-03_06H...
8 months ago

Add WPT tests for fetchpriority in early hints preload.

The logic to handle Link headers [1] is the same for 103 Early hints
reponses [2] as for 200 OK reponses. Tests are added to verify that the
fetchpriority attribute is properly handled in early hints:

  1. A new test preload-fetchpriority.html verifies that the presence
    of fetchpriority=low/high/auto does not affect proper handling of
    early hints. This test is copied from preload-initiator-type.html.
    For that purpose, the helper scripts early-hints-helpers.sub.js
    and early-hints-test-loader.h2.py are adjusted so that they accept
    a fetchpriority_attr parameter.

  2. link-tests-data.js (used by fetchpriority-disabled.h2.html and
    fetchpriority.h2.html) is extended to handle the cases when
    Link as=font/image/fetch/script/style headers are added in early
    hints. The corresponding link-early-hints-*.h2.html pages don't
    check whether the initiator type is "early-hints". Instead,
    the helper scripts early-hints-helpers.sub.js and
    early-hints-test-loader.h2.py are adjusted so that accept a new
    boolean allowing to exclude the preload headers from the
    200 OK response.

[1] https://html.spec.whatwg.org/multipage/semantics.html#processing-link-headers
[2] https://html.spec.whatwg.org/multipage/semantics.html#early-hints

Differential Revision: https://phabricator.services.mozilla.com/D209632

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1882084
gecko-commit: dc3dee64abfb06d2e00d9b98f42d5b1e44132459
gecko-reviewers: valentin

Don't miss a new wpt release

NewReleases is sending notifications on new releases.