Commit Graph
1233 Commits
Author SHA1 Message Date
ldm0 db79f4a746 fix(xhr): apply enum attribute rules to responseType
Ignore unsupported responseType values without resetting the selected type,
including historical moz-* tokens. Convert the value to a string before XHR
state checks and preserve conversion exceptions and reentrant state changes.
A missing setter argument is converted like undefined and ignored.

Validate native getter/setter receivers before conversion. Ignore document in
Workers before checking LOADING or DONE, while retaining InvalidStateError and
InvalidAccessError for valid values where the XHR setter algorithm requires it.

Cover Window and Worker conversion, borrowed accessors, forged receivers,
response identity, and open/send reentrancy over real HTTP. Correct the legacy
test expectations for invalid enum assignments and historical moz-* tokens.

https://webidl.spec.whatwg.org/#dfn-attribute-setter
https://xhr.spec.whatwg.org/#the-responsetype-attribute

Validation: cargo fmt --all; workspace Clippy with all targets/features and
-D warnings; cargo nextest run --no-fail-fast (18161 passed, 13 skipped).
192 upstream WPT cases: 175 -> 178 pass, 726 -> 748 passing subtests,
no new regressions. Window and Worker responseType matrices both pass 50/50.
2026-09-14 18:42:35 +08:00
ldm0 f391571d85 fix(xhr): validate open calls before changing request state
Reject invalid HTTP method tokens with SyntaxError and forbidden methods with
SecurityError. Share validation with Fetch while preserving its TypeError
behavior. Validate native receivers before argument conversion and document
activity before method and URL processing.

Create exceptions in the invoked method realm, including when DOMException is
first materialized after WindowProxy detachment. Resolve its prototype from
the realm-owned intrinsic registry. Preserve pending requests, headers,
responses, and events when open fails.

Cover Window and Worker conversion order, native receiver identity, cross-realm
inactive documents, retired cold realms, and request preservation on the wire.

Validation: cargo fmt --all; workspace Clippy with all targets/features and
-D warnings; cargo nextest run --no-fail-fast (18157 passed, 13 skipped).
189 upstream WPT cases: 171 -> 174 pass, 624 -> 642 passing subtests. Four
cases improve. open-url-multi-window-6.htm now fails its caller-realm
constructor assertion; two popup probes using the method-realm expectation
improve from fail to pass. The original WPT and raw comparison are unchanged.
WebIDL specifies the method realm for DOMExceptions:
https://webidl.spec.whatwg.org/#js-creating-throwing-exceptions
2026-09-14 18:42:35 +08:00
ldm0 37eef5dce0 fix(xhr): dispatch errors when streamed response bodies fail
Complete active page XHRs with the request-error steps when a response
stream fails after delivering partial data. Reset the response and dispatch
error/loadend instead of leaving the request in LOADING.

Check the request identity for stream and body-materialization failures so
queued errors cannot overwrite an aborted or reopened XHR. Exercise real
truncated Content-Length and malformed chunked responses, including abort,
open, and resend before a queued failure is delivered.

Validation: cargo fmt --all; full workspace clippy with warnings denied;
cargo nextest run --no-fail-fast (18,153 passed, 13 skipped).
Focused upstream WPT: 83/88 cases and 133/143 subtests pass, up from 82/88
and 132/143, with no regressions. Page malformed-body error now passes.
2026-09-14 18:42:34 +08:00
ldm0 4e375fc8a9 fix(wpt): model XHR network error fixtures
Serve the upstream malformed chunk sequence and infinite redirect loop
instead of returning Python source. Preserve redirect parameters and origin,
explicit raw body writes, and supported endpoint filtering.

Validation: all 550 benchmark tests pass, including raw wire and partial
HTTP body decoding regressions. With the same Moli binary, 88 focused WPT
cases improve from 77 to 82 passes (127 to 132 of 143 subtests).

The corrected fixture also exposes a page XHR bug: malformed-body handling
now times out instead of failing on unexpected load. Its streaming failure
branch records the network error without dispatching XHR error/loadend;
that engine fix follows separately. The worker variant now passes.
2026-09-14 18:42:34 +08:00
ldm0 ce4f404901 fix(xhr): queue early worker request failures
Route URL and network policy rejections through the pending worker XHR
completion queue so send() returns before error delivery. Immediate abort()
and open() can cancel the queued failure. Validate request identity before
applying a completion so old failures cannot overwrite a new send.

Cover six rejection causes, listeners installed after send, microtask abort,
reopen and resend, synchronous NetworkError, and duplicate failure records.

Validation: cargo fmt --all; full workspace clippy with warnings denied;
cargo nextest run --no-fail-fast (18,152 passed, 13 skipped).
Focused upstream WPT: 77/86 cases and 127/141 subtests pass, up from 76/86
and 126/141, with no regressions. Worker abort-with-error now passes.
2026-09-14 18:42:34 +08:00
ldm0 3f51e2cce8 fix(xhr): drive upload events from network transmission
Observe transmitted request bytes in the native transport and queue upload
progress and completion in the owning page or worker realm. Cover empty
bodies, resumed requests, redirects, and partial uploads without fabricating
completion during send().

Mark uploads complete before final callbacks and reject stale events after
abort or reopen. Preserve upload error events and update local smoke tests
to collect the full final upload task.

Validation: cargo fmt --all; full workspace clippy with warnings denied;
cargo nextest run --no-fail-fast (18,148 passed, 13 skipped).
Focused upstream WPT: 67/73 passing versus 65/73, 114/125 subtests versus
112/125, with no regressions.
2026-09-14 18:42:34 +08:00
ldm0 5ee6154336 fix(xhr): require CORS preflight for upload listeners
Snapshot upload listeners before send callbacks and carry the preflight
requirement through page and worker requests, redirects, interception,
authentication continuations, and service worker network fallback. Route
synchronous worker XHR through the shared CORS transport and validate
preflight responses using the actual request credentials mode.

Add real HTTP regressions for listener timing, sync and async requests,
redirects, interception, credentials, and denied preflights. Update existing
PageVm response fixtures to authorize preflights before testing the actual
CORS response and to respect the shared redirect limit.

Validation: cargo fmt --all; full workspace clippy with warnings denied;
cargo nextest run --no-fail-fast (18,142 passed, 13 skipped). The 73 selected
upstream WPT cases retain 65 passing cases and 112/125 passing subtests,
with no regressions.
2026-09-14 18:33:41 +08:00
ldm0 abee9e403f fix(xhr): order upload startup events and snapshot listeners
Dispatch XHR loadstart before upload loadstart and report zero initially transmitted bytes. Snapshot registered upload listeners before callbacks and preserve requests reopened or aborted during startup in both page and worker realms.

Use non-computable zero-total upload events and update local compatibility expectations. Real transport-driven upload progress and completion remain a separate follow-up.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast (18139 passed, 13 skipped). Selected upstream WPT: 51 to 59 passing cases out of 66; 68 to 80 passing subtests out of 89, with no regressions.
2026-09-14 18:05:39 +08:00
ldm0 918cbd0190 fix(wpt): serve the XHR CORS echo fixture
Match the upstream corsenabled.py response headers, request metadata reflection, query-controlled delay and additional Content-Type allowance. Recognize exact relative and absolute fixture references during XHR case selection.

Validation: all 545 Python tests pass, including six new fixture tests. With an unchanged engine binary, nine CORS WPT cases improve from 1 to 6 passing and subtests from 14 to 36 of 44, with no regressions.
2026-09-14 17:57:10 +08:00
ldm0 ec4778cb3e fix(xhr): preserve abort state transitions and reentrant requests
Use internal ready state and the send flag to select abort error steps in both page and worker contexts. Keep OPENED requests before send unchanged, reset completed responses without new error events, and fire readystatechange before active-request abort events. Preserve requests reopened by event callbacks.

Validation: cargo fmt --all, full workspace Clippy with warnings denied, and cargo nextest run --no-fail-fast pass (18,135 passed, 13 skipped). The final binary improves 50 abort-related WPT cases from 21 to 42 passing and subtests from 31 to 54 of 62, with no regressions.
2026-09-14 17:57:10 +08:00
ldm0 9e40fe628e fix(wpt): serve script charset fixture with original bytes
Serve the requested Content-Type and unchanged file bytes, and recognize exact absolute and relative handler references during case selection.

Validation: all 539 Python tests pass, including six new fixture tests. Eight complete charset WPT cases improve from 3 to 8 passing (32/32 subtests). Results match the upstream handler on all ten selected cases; two upstream cases omit a required ct parameter and are excluded from complete-case gains.
2026-09-14 17:44:37 +08:00
ldm0 f84c99d671 fix(fetch): send zero content length for bodyless PUT requests 2026-09-14 17:44:37 +08:00
ldm0 d630d8e5c9 fix(wpt): serve the XHR request-header echo fixture 2026-09-14 17:44:37 +08:00
ldm0 2654b4dd23 fix(wpt): deduplicate fixture definitions after main rebase
Keep one copy of the identical Fetch stash and status, trickle, and abort handlers, along with their regression tests. The merged status helper remains shared by Fetch and XHR.

Validation: 256 WPT fixture and harness Python tests passed.
2026-09-14 17:43:46 +08:00
ldm0 a752138b97 fix(xhr): preserve response document modification times
Store the response Last-Modified timestamp on each XML or HTML response
Document using the existing HTTP date parser. Preserve current-time fallback
for unknown dates and keep metadata independent of the requester and XHR reuse.

Cover buffered and streamed responses, child-realm access, invalid and missing
headers, epoch timestamps, old response Documents, and timezone changes.
2026-09-14 17:43:46 +08:00
ldm0 50d7b1ccc1 fix(xhr): decode response bytes using the response encoding
Honor response and override charsets, BOMs, and XML or HTML encoding
declarations across buffered, queued, and streaming delivery. Reuse the
HTML document decoder with UTF-8 fallback and expose its selected charset.
Keep JSON decoding fixed to UTF-8 and binary responses byte-exact.

Select the decoder after HEADERS_RECEIVED handlers can change the MIME
override. Keep queued response bytes intact and handle split BOMs and
multibyte characters in streaming text.
2026-09-14 17:43:46 +08:00
ldm0 62be128961 fix(fetch): preserve received HTTP status text
Carry the wire reason phrase through buffered and streaming transport,
response conversion, cache, and Window/Worker Fetch and XHR delivery.
Preserve explicitly empty messages, including HTTP/2 and HTTP/3, and
Latin-1 reason bytes while retaining existing synthetic defaults.

Bump cache metadata to version 4 and keep the original status message
when revalidating an entity with a 304 response. Cover transport modes,
cache reloads, response conversions, and streaming XHR state changes.
2026-09-14 17:43:46 +08:00
ldm0 b3c644db40 fix(xhr): reject ineligible document responses
Return null for failed XML parsing while preserving DOMParser error Documents.
Apply the text/xml response MIME fallback and recognize arbitrary +xml
subtypes. Restrict HTML parsing to the document response type. Parse MIME
overrides at the setter so invalid values select application/octet-stream.

Cover buffered, queued and streaming responses, valid author parsererror
elements, document identity and XHR reuse.
2026-09-14 17:43:46 +08:00
ldm0 3d04d737e7 fix(wpt): serve XHR status and last-modified fixtures
Expose the upstream status.py response bytes, status text, Content-Type
and request method using the existing Fetch status parameter parser.
Serve well-formed.xml and its file modification date for last-modified.py.

Recognize both resource paths during case enumeration and cover real HTTP
responses, custom methods, HEAD, unused uploads, byte payloads and mtime.
2026-09-14 17:43:46 +08:00
ldm0 aabb75beb7 fix(dom): expose live HTMLCollections on every Document
Use the native live collection queries for XML and detached HTML Documents,
with stable receiver-realm objects instead of detached snapshots.

Match HTML elements and unnamespaced href/name attributes, include area in
links, alias plugins to embeds, and keep applets permanently empty.

Cover mutation, adoption, namespace filtering, borrowed getters and receiver
validation; remove the obsolete detached collection scanners.
2026-09-14 17:43:46 +08:00
ldm0 38ef82b716 fix(xhr): preserve response document URLs and requester origins
Parse response documents with the final response URL in the XHR creation
realm. Inherit the requester origin separately for CORS responses, and keep
relative URL resolution consistent through base insertion/removal/adoption.

Validated with cargo fmt, workspace clippy, and nextest (17991 passed,
13 skipped). All 935 contract checks pass; the 75-case WPT suite gains five
passing subtests with no regressions. Chromium passes all 61 new checks.
2026-09-14 17:43:46 +08:00
ldm0 e090f2b070 fix(file-api): authorize blob URL revocation by storage key
Record the URL creator's storage key and browser partition independently of
its backing Blob, and check authorization atomically with URL removal.
Use the Worker's environment key and share opaque-origin nonce allocation
between Windows and Workers so unrelated opaque origins cannot collide.

Validated with cargo fmt, workspace clippy, and nextest (17990 passed,
13 skipped). Cross-global revoke WPT passes 3/3; all 874 contract checks pass,
with no regressions across the 68-case WPT suite.
2026-09-14 17:43:46 +08:00
ldm0 d993cb034f fix(fetch): preserve RequestInit conversion exceptions
Read headers and signal through exception-preserving helpers. Capture
conversion exceptions around Window and Worker fetch argument parsing so
rejected promises retain the original thrown value, including primitives,
instead of replacing it with a TypeError or starting a request.

Cover constructor and fetch exception identity, unused input bodies, no
network dispatch, and cross-realm Promise ownership.

Validation: cargo fmt, workspace Clippy with warnings denied, and nextest
(17987 passed, 13 skipped). 68 upstream WPT cases show no regressions.
All 832 additional checks pass, including the eight pre-existing getter
exception failures identified during the preceding blob URL fix.
2026-09-14 17:43:46 +08:00
ldm0 731c2dd2a9 fix(fetch): retain parsed blob URL entries across revocation
Capture shared blob bytes when Request is constructed or XHR is opened,
and retain the entry through cloning, Window/Worker fetches, and request
interception. Fresh URLs and reopened XHRs still observe revocation.

Private isolate-scoped carriers release their references on GC or isolate
teardown, while requests survive cleanup of the creating realm.

Validation: cargo fmt, workspace Clippy with warnings denied, and nextest
(17986 passed, 13 skipped). Fixes seven upstream WPT failures; 58 cases
show no regressions. Additional contract checks improve from 332 to 440
out of 448; eight pre-existing getter-exception failures remain separate.
2026-09-14 17:43:46 +08:00
ldm0 0ee4db49df fix(fetch): reject non-GET blob URL requests 2026-09-14 17:34:55 +08:00
ldm0 f796dd8fcc fix(xhr): serialize document bodies and normalize text charsets 2026-09-14 17:23:42 +08:00
ldm0 74b3465cd6 fix(wpt): serve XHR body and document fixtures 2026-09-14 17:23:42 +08:00
ldm0 c0765e1059 fix(fetch): preserve explicitly empty request headers
Use libcurl's explicit-empty header syntax and keep upload Content-Type
suppression internal to the transport, including custom methods. Remove
Fetch and XHR suppression sentinels from Window and Worker request paths.

Cover empty versus absent values on the wire for streaming and buffered
auth transport, plus Window/Worker Fetch, Request clones and async/sync XHR.

Validation: cargo fmt --all; workspace clippy with all targets/features
and -D warnings; cargo nextest run --no-fail-fast (17975 passed, 13 skipped).
37 WPT cases gain 12 passing subtests without regressions; all 1540
additional request-header checks pass.
2026-09-14 17:23:42 +08:00
ldm0 70dc2e8f26 fix(xhr): validate and combine author request headers
Normalize header values after WebIDL conversion and state checks, reject
invalid names or values with SyntaxError, and ignore forbidden request
headers. Combine repeated values with comma-space while retaining the
first name and empty list members.

Keep quoted strings intact in the shared method-override filter so quoted
commas do not turn permitted values into forbidden methods. Cover error
ordering, reentrant argument conversion, and actual outgoing headers.

Validation: cargo fmt --all, workspace all-targets/all-features Clippy with
-D warnings, and cargo nextest run --no-fail-fast pass (17973 passed,
13 skipped). The 37-case WPT check improves from 22 to 27 passing cases and
300 to 388 passing assertions, without regressions. All 20 supplemental
Window/Worker checks pass across synchronous and asynchronous XHR.
2026-09-14 17:14:45 +08:00
ldm0 92b9772953 fix(wpt): serve XHR request header inspection fixture
Implement xhr/resources/inspect-headers.py with raw header names, duplicate
values, byte-preserving filters, and its upstream CORS response headers.
Support HEAD, uploads, and custom methods through the shared XHR dispatch,
and recognize the supported fixture references during case selection.

Validation: all 516 benchmark unit tests pass. 84 HTTP comparisons match
the unmodified upstream handler. With the same Moli binary, 31 WPT cases
improve from 9 to 18 passes and from 80 to 114 passing subtests, without
regressions.
2026-09-14 17:14:45 +08:00
ldm0 b55d058f08 fix(wpt): serve XHR request URI and redirect fixtures
Implement requri.py and redirect.py with their upstream query, status,
Location, delay, and method behavior. Preserve raw request URIs and allow
redirect responses before the upload completes.

Recognize supported XHR references during case selection and cover the
fixtures through real HTTP requests.

Validation: all 510 benchmark unit tests pass. With the unchanged Moli
binary, 17 WPT cases improve from 6 to 9 passes and 72 to 79 passing
subtests; both redirected Worker harnesses now execute their assertions.
2026-09-14 17:14:45 +08:00
ldm0 4b16b1b316 fix(fetch): exclude fragments from response URL getters
Serialize Response.url and XMLHttpRequest.responseURL without fragments
at the getter boundary. Keep stored response URLs and Request.url intact,
including query strings and percent-encoded hash characters.

Cover Fetch clones and asynchronous/synchronous XHR for local responses.
2026-09-14 17:14:45 +08:00
ldm0 c8f6158f9a fix(blob): generate UUIDs for object URL identifiers
Use a fresh random UUID for each object URL, as required by File API,
instead of a decimal counter. Reuse the existing UUID generator and check
for collisions while holding the URL map lock.

Extend the lifetime regression to cover independently revoking two URLs
created from the same Blob.
2026-09-14 17:14:45 +08:00
ldm0 4010cd8c8e fix(blob): scope realm URL cleanup to its resource owner
Realm tokens are allocated per JsContextHost while the BlobStore is shared.
Match both resource owner and realm token when retiring ordinary or isolated
window contexts, including failed bootstrap cleanup.

Extend the store and renderer regressions for colliding lifetime identifiers
across two owners and two live VMs.
2026-09-14 17:14:45 +08:00
ldm0 884ba3f7fc fix(page-visibility): keep synthetic iframe documents hidden
Reading contentWindow on an iframe in a windowless document must not make
its synthetic child document visible. Determine browsing-context ownership
from native top-level, child frame, and popup registrations, preserving
the document's retained visibility state separately from defaultView.

Cover both getter access orders, nested synthetic frames, and cross-realm
visibility/defaultView getters on live documents and popups.

Follow-up to #501.
2026-09-14 17:14:45 +08:00
ldm0 f8f9c003fe fix(fetch): resolve opaque responses before body completion
Resolve no-cors Fetch responses at their headers in Window and worker realms, preserving header policy checks and cancellation. Keep suspect opaque bytes in capture storage until the existing ORB classifier approves them, including clone, CacheStorage and service-worker consumers.

Verify unfinished streams and real connection closure across Window, child Window and worker realms. All workspace gates pass; 83 related WPT cases gain two abort subtests without regressions.
2026-09-14 17:14:45 +08:00
ldm0 96fe2e9794 fix(wpt): model fetch abort stash and streaming fixtures 2026-09-14 17:03:03 +08:00
ldm0 457573d32d fix(fetch): cancel pre-aborted uploads synchronously
Preserve the selected request body stream in Window and Worker fetch
bindings. Reject with the original abort reason before synchronously
canceling a readable upload, and handle the internal cancellation promise
without replacing the fetch rejection or reading public Promise methods.

Merge RequestInit bodies and inherited methods before validating the
effective request. Nullish body overrides inherit the input body; invalid
stream options and GET/HEAD bodies fail construction before cancellation.
Remove the obsolete public then shim and its classified direct-call entry.

Add regression coverage for cancellation timing, reason identity, source
errors, body selection, reentry, validation and modified public intrinsics
in Window, iframe and Worker contexts.

Validation: fmt and strict workspace Clippy passed; nextest passed 17,962
tests with 13 skipped. All 12 pre-abort and 3 ordinary-upload CLI probe
groups passed. The 83-case WPT selection gains two passing subtests with
no regressions or new failures; whole-case counts remain 77 pass / 6 fail.
2026-09-14 17:03:03 +08:00
ldm0 f08888b57d fix(fetch): create binary body results in receiver realm
Allocate Body.arrayBuffer() and Body.bytes() results in the receiver's
creation context for buffered, author-stream and pending network bodies.
Retain that context across asynchronous completion and recognize readable
bodies by their internal brand when methods are borrowed across realms.

Add Request/Response regression coverage for both iframe borrowing
directions, null bodies, byte contents, asynchronous and cloned streams,
prototype changes, network rewrapping, and original stream error identity.

Validation: cargo fmt --all; strict workspace Clippy; nextest (17,958
passed, 13 skipped). The 81-case WPT selection improves from 73 to 75
passing cases with no regressions or new failed subtests. All four CLI
regression groups pass (176 checks).
2026-09-14 17:03:03 +08:00
ldm0 a5f1fee323 fix(fetch): consume body streams with internal read requests
Read and copy Uint8Array chunks through native chunk, close, and error
steps, then materialize using the shared body conversions. Defer internal
streaming callbacks until response registration and network delivery finish.

Remove the JavaScript bootstrap consumer and intrinsic reader plumbing.
Cover inherited then handlers, chunk mutation and detachment, exceptions,
and constructor tampering in window, iframe, and worker contexts.
2026-09-14 17:03:03 +08:00
ldm0 e9c9ef530b fix(streams): disturb source synchronously when piping starts 2026-09-14 16:54:37 +08:00
ldm0 c2d2eb3f90 test(intl): compare Date locale output against native Intl 2026-09-14 16:54:37 +08:00
ldm0 5e0f4a38e5 fix(fetch): clone Response stream chunks and header state 2026-09-14 16:54:37 +08:00
ldm0 71bf274e43 fix(wpt): stream the Fetch trickle fixture response
Model trickle.py by draining the request body, delaying headers and body
chunks, and writing TEST_TRICKLE lines according to ms/count. Preserve the
optional Content-Type omission and close-delimited response framing.

Exercise supported methods, defaults, duplicate/invalid parameters,
progressive delivery, and both fixed-length and chunked uploads.

Validation: 221 Python tests passed. With the same Moli binary, 16 WPT
cases add two passing cases and eight passing subtests, with no regressions.
No Rust source or build metadata changed.
2026-09-14 16:54:37 +08:00
ldm0 3c3bd08064 fix(fetch): remove an initial UTF-8 BOM from Body text and JSON
Decode buffered and fetched text/json bodies with UTF-8 BOM removal before
creating strings or invoking the native JSON parser. Remove exactly one
initial BOM, retain replacement behavior for malformed UTF-8, and keep
binary/form consumers unchanged. Borrow valid UTF-8 while materializing.

Cover constructed Request/Response bodies, delayed ReadableStream input,
data URLs, and chunked HTTP in window, child frame, and worker realms.
Include split/repeated BOMs, UTF-16 markers and MIME charset, SyntaxError,
clone ordering, raw bytes, and URL-encoded/multipart form values.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets
--all-features -- -D warnings; cargo nextest run --no-fail-fast
(17,946 passed, 13 skipped); 9/9 CLI probes. A 40-case WPT comparison adds
four passing cases and ten passing subtests without regressions.
2026-09-14 16:54:37 +08:00
ldm0 16933d66e1 fix(fetch): preserve and clone Request stream bodies
Retain ReadableStream BodyInit values instead of extracting empty bytes.
Validate stream construction options, tee cloned bodies with independent
chunks, and proxy inherited stream-only bodies while immediately marking
the original disturbed. Use native stream operations for cancellation and
error propagation even when public stream methods are overridden.

Cover consumption, clone isolation, validation, errors, and cancellation in
window, child-frame, and worker realms. The 37-case Fetch WPT comparison
adds four passing cases and six passing subtests without regressions;
public stream tee still passes all 52 subtests.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets
--all-features -- -D warnings; cargo nextest run --no-fail-fast
(17,943 passed, 13 skipped); 9/9 CLI regression probes.
2026-09-14 16:54:37 +08:00
ldm0 0e5e935a25 fix(fetch): return null bodies for HEAD and bodyless statuses
Carry request methods through buffered, streaming, Worker, and navigation
preload response creation. Discard public and filtered internal bodies before
registering streams, so null bodies remain reusable through reads, clones,
and aborts while empty GET responses keep their streams.

Cover real HTTP responses in Window, iframe, and Worker and verify pending
body sources do not retain late chunks or terminal events.

Validation: cargo fmt --all; workspace Clippy with all targets/features and
-D warnings; nextest 17,940 passed, 13 skipped. Focused WPT comparison gained
2 complete cases and 20 subtests across 69 cases with no new failures.
2026-09-14 16:46:24 +08:00
ldm0 1cfbe01f25 fix(webapi): reconcile replayed bitmap and Fetch bindings
Use the shared ImageData interface identity during BitmapSource conversion
and remove Fetch interface imports made obsolete by replayed body changes.
Preserve the existing bitmap conversion order.
2026-09-14 16:38:46 +08:00
ldm0 9f6e97047c fix(wpt): model Fetch status fixture responses
Serve fetch/api/resources/status.py with upstream status, reason, method
header and byte-preserving query content across supported request methods.
Keep duplicate parameter precedence and explicit empty values intact.

Validate fixture parameters and 32 HTTP status/method combinations. The
focused CLI comparison gains 16 UTF-8 subtests with the same engine binary;
null response bodies and BOM handling remain separate engine defects.
2026-09-14 16:27:32 +08:00
ldm0 b5dcb333df fix: synchronize Fetch body consumption with stream state
Derive Body usability and bodyUsed from native stream state, preserve reader locks during consumption, and keep null bodies reusable. Reject unusable stream inputs and propagate body conversion failures through their promises.

Use native reader operations without forcing lazy Streams interfaces during bootstrap. Cover buffered and streaming bodies in Window, iframe, and Worker; update null-body expectations and WPT pass lists.
2026-09-14 16:27:32 +08:00