Skip to content

WIP feat: increased WPT compatibility#1553

Draft
richarddavison wants to merge 2 commits into
mainfrom
feat/wpt-compat
Draft

WIP feat: increased WPT compatibility#1553
richarddavison wants to merge 2 commits into
mainfrom
feat/wpt-compat

Conversation

@richarddavison
Copy link
Copy Markdown
Collaborator

Description of changes

Major refactor to for increased Web Platform compatibility. This branch raises bundle/js/__tests__/wpt from below 100 to 169.

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 force-pushed the feat/wpt-compat branch 2 times, most recently from a3063a0 to c5ed78a Compare May 12, 2026 14:26
…bCrypto

Raises bundle/js/__tests__/wpt from 161 to 169 passing tests (out of 180)
with zero unit-test regressions, through a series of targeted spec-
correctness fixes.

Fetch: real Subresource Integrity verification (sha-256/384/512 with
strongest-metadata selection and base64+base64url decoding); 421
Misdirected Request retry on a fresh TCP connection per Fetch \u00a74.5;
duplex: 'half' enforcement for streaming request bodies; reject_with_error
now surfaces the actual JS exception value instead of an uninitialized
one.

URL: Windows drive-letter normalization (/w|/ -> /w:/); file-URL host
preservation when path has a drive letter; USVString conversion on
constructor input (lone UTF-16 surrogates -> U+FFFD); spec-correct port
setter whitespace handling; /.-sentinel stripping on set_hostname;
blob-URL origin null-opacity for non-HTTP(S) inner URLs; trailing-space
percent-encoding on non-special opaque paths.

Streams: implement type: 'owning' with structural-transfer on
controller.enqueue(chunk, {transfer}); fix reentrancy borrow conflict in
byobRequest when user code patches Object.prototype.then mid-enqueue;
Rust-side direct-drain of closed ReadableStream queues so
Response.text()/.json() etc. resist Object.prototype.then pollution.

WebCrypto: subtle.digest snapshots input bytes synchronously at call time
(no longer at first poll), so post-call buffer mutations can't alter the
result; detached BufferSource is treated as empty per WebIDL. TextDecoder
got the same detached-buffer treatment.

Also: console counters/timers moved from thread_local! to
Ctx::store_userdata so multiple contexts don't conflate state.
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