Add tests for modulepreload links with JSON and CSS, remove json with non-module preload#56617
Merged
yoavweiss merged 15 commits intoweb-platform-tests:masterfrom Jan 30, 2026
Conversation
Contributor
Author
|
@annevk FYI |
6 tasks
yoavweiss
reviewed
Dec 10, 2025
| }); | ||
| }, 'link rel=modulepreload'); | ||
|
|
||
| promise_test(function(t) { |
Contributor
There was a problem hiding this comment.
Should this be a utility function that accepts the different URLs and as values?
Contributor
Author
There was a problem hiding this comment.
Latest commit revamps this to take an array of module types for shared tests. That way we can have unique tests for each module type. This reduced a lot of duplication. It's not used everywhere because a lot of these tests are unique for script, but it'll make it much easier to expand for future module types like "text".
annevk
reviewed
Jan 13, 2026
Member
annevk
left a comment
There was a problem hiding this comment.
This looks good to me but it seems like it needs rebasing to get CI to be green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per whatwg/html#10233, "json" and "style" should be supported for modulepreload. This PR adds tests for this.
In the PR to update the HTML5 spec for these changes, it was also recommended that support for non-module JSON preloads be removed, as it only makes sense in a module context. This change also updates tests for that scenario.
The existing tests had a flakiness problem that this change addressed in order to satisfy the "unstable results" bots. Specifically,
modulepreload-as.htmlwas modified fairly substantially. It no longer checksperformance.getEntriesByName, as the preload scanner was fetching the files and firing events, but the performance entries were not always getting updated in time for the test. Now, the test only checks for events fired, as that is all we can determine consistently at test time. The event handlers were also moved to markup, which avoids a race between the preload scanner fetching the files and the event handlers being added.