Skip to content

Add the WPT xhr/formdata suite - #8523

Merged
littledivy merged 1 commit into
mainfrom
littledivy/2026-11-17-wpt-xhr-formdata
Nov 17, 2026
Merged

littledivy merged 1 commit into
mainfrom
littledivy/2026-11-17-wpt-xhr-formdata

Conversation

@littledivy

Copy link
Copy Markdown
Member

The xhr/formdata *.any.js files test FormData itself and need no XMLHttpRequest, but workerd did not run them.

In this patch src/wpt gains a wpt_test for @wpt//:xhr/formdata. Seven of the nine files pass. Four cases are marked as expected failures, each with the reason:

  • The FormData constructor accepts any argument, so new FormData(null) and new FormData("string") don't throw a TypeError.
  • A Blob added without a filename is named after the entry ("blob-1") instead of "blob".
  • A File added with a new filename loses its lastModified.

These are runtime behaviour changes, so they are left for separate patches.

The xhr/formdata *.any.js files test FormData itself and need no
XMLHttpRequest, but workerd did not run them.

In this patch src/wpt gains a wpt_test for @wpt//:xhr/formdata. Seven of
the nine files pass. Four cases are marked as expected failures, each
with the reason: the FormData constructor accepts any argument instead
of throwing a TypeError, a Blob added without a filename is named after
the entry instead of "blob", and a File added with a new filename loses
its lastModified.
@littledivy
littledivy requested review from a team as code owners November 17, 2026 06:15

@clanky-the-clanker clanky-the-clanker Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Approved — This adds WPT coverage for FormData without changing the runtime, and each expected failure states a reason that matches the current code. I found no issues.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

📋 Code Quality: ✅ LGTM

The new wpt_test target and xhr/formdata-test.ts config follow the conventions the existing WPT suites use. Each expected failure has a comment, and each comment matches what the runtime does now.


📝 Documentation: ✅ LGTM

Each expected failure's comment describes what the runtime does now. No documentation changes are needed.


Reviewed commit: b2ed4948

@littledivy
littledivy merged commit e4a2666 into main Nov 17, 2026
23 checks passed
@littledivy
littledivy deleted the littledivy/2026-11-17-wpt-xhr-formdata branch November 17, 2026 06:45
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.

2 participants