Skip to content

feat(fetch): Add WPT tests and improve FormData compatibility#1637

Open
nabetti1720 wants to merge 3 commits into
awslabs:mainfrom
nabetti1720:feat/improve-formdata
Open

feat(fetch): Add WPT tests and improve FormData compatibility#1637
nabetti1720 wants to merge 3 commits into
awslabs:mainfrom
nabetti1720:feat/improve-formdata

Conversation

@nabetti1720

Copy link
Copy Markdown
Contributor

Issue # (if available)

n/a

Description of changes

  • Added WPT tests for xhr/formdata.
  • As a result, we detected several tests that were failing and fixed them.
 PASS  xhr.formdata.test.js 224.489ms
xhr/formdata 223.534ms
  ✔ should pass append.any.js tests 134.984ms
  ✔ should pass constructor.any.js tests 10.700ms
  ✔ should pass delete.any.js tests 9.196ms
  ✔ should pass foreach.any.js tests 9.562ms
  ✔ should pass get.any.js tests 8.877ms
  ✔ should pass has.any.js tests 8.420ms
  ✔ should pass iteration.any.js tests 13.336ms
  ✔ should pass set-blob.any.js tests 11.256ms
  ✔ should pass set.any.js tests 12.125ms

Checklist

  • Created unit tests in tests/unit and/or in Rust for my feature if needed
  • Ran make fix to format JS and apply Clippy auto fixes
  • Made sure my code didn't add any additional warnings: make check
  • Added relevant type info in types/ directory
  • Updated documentation if needed (API.md/README.md/Other)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@richarddavison richarddavison left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for this! Small suggestion!

Comment thread modules/llrt_fetch/src/form_data.rs Outdated
@nabetti1720 nabetti1720 marked this pull request as draft July 1, 2026 15:20
@richarddavison richarddavison force-pushed the feat/improve-formdata branch 2 times, most recently from b4b188d to 6c67ffd Compare July 10, 2026 15:02
@nabetti1720 nabetti1720 marked this pull request as ready for review July 10, 2026 15:53
@richarddavison richarddavison force-pushed the feat/improve-formdata branch 2 times, most recently from 858b6e0 to 7576813 Compare July 10, 2026 18:43
Replace the snapshot-based iterators with live, index-based ones that
observe mutations during iteration (WebIDL semantics), fixing the
xhr/formdata iteration.any.js WPT test. A single LiveIterator class in
llrt_utils holds the backing collection as a JS value plus a function
that reads its entries, so Headers, FormData, and URLSearchParams share
one iterator type. Drop the now-unused IteratorDef trait and
map_to_entries helper.
@richarddavison richarddavison force-pushed the feat/improve-formdata branch from 7576813 to cf08179 Compare July 10, 2026 18:43
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.

3 participants