Skip to content

XMLHttpRequest: improve Content-Type manipulation coverage#59769

Merged
annevk merged 2 commits into
masterfrom
revert-54561-servo_export_38993
May 14, 2026
Merged

XMLHttpRequest: improve Content-Type manipulation coverage#59769
annevk merged 2 commits into
masterfrom
revert-54561-servo_export_38993

Conversation

@annevk

@annevk annevk commented May 9, 2026

Copy link
Copy Markdown
Member

#54561 removed a test case citing whatwg/xhr#205 as reason, but I cannot find in there the reason for why this test was removed and if anything is to be changed it is the expectations. We should only remove test coverage when the exact scenario is already covered elsewhere. It does not seem like this was such a case as I presume Servo fails this test, while WebKit for instance is passing it.

@annevk annevk requested a review from jdm May 9, 2026 07:15
@wpt-pr-bot wpt-pr-bot added the xhr label May 9, 2026
@annevk

annevk commented May 9, 2026

Copy link
Copy Markdown
Member Author

cc @Gae24

@annevk

annevk commented May 9, 2026

Copy link
Copy Markdown
Member Author

I think I see, per #13273 the issue is that XMLHttpRequest says this only applies to USVString or Document arguments, but here browsers apply it to URLSearchParams.

We should probably test the other types of arguments and see which ones browsers overwrite with UTF-8 as well and then update the XMLHttpRequest specification.

webkit-commit-queue pushed a commit to annevk/WebKit that referenced this pull request May 9, 2026
https://bugs.webkit.org/show_bug.cgi?id=314468

Reviewed by Brandon Stewart.

Also mark
imported/w3c/web-platform-tests/xhr/send-redirect-post-upload.htm as
passing as the remaining issues had been tackled seven years ago.

We also account for
web-platform-tests/wpt#59769 and for now do not
import the sync-xhr permission policy tests as that is non-standard.

Upstream commit: web-platform-tests/wpt@d6f9273

Canonical link: https://commits.webkit.org/312947@main
@Gae24

Gae24 commented May 9, 2026

Copy link
Copy Markdown
Contributor

Honestly, I can't recall exactly why I dropped the test case, but it was most likely due to the same findings mentioned in #13273.

@annevk annevk force-pushed the revert-54561-servo_export_38993 branch from a58696b to 4104271 Compare May 14, 2026 13:13
annevk added a commit to whatwg/xhr that referenced this pull request May 14, 2026
@annevk annevk changed the title Revert "XMLHttpRequest Send: fix Content-Type failures" XMLHttpRequest: improve Content-Type manipulation coverage May 14, 2026
@annevk

annevk commented May 14, 2026

Copy link
Copy Markdown
Member Author

I created a patch to update the specification here whatwg/xhr#406 and repurposed this revert PR to improve coverage.

@annevk annevk merged commit cdd883f into master May 14, 2026
28 checks passed
@annevk annevk deleted the revert-54561-servo_export_38993 branch May 14, 2026 14:26
annevk added a commit to whatwg/xhr that referenced this pull request May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants