Commit Graph
3995 Commits
Author SHA1 Message Date
ldm0 f81f514b1a fix(fetch): preserve opaque response metadata through service workers
Keep internal response status, status text and headers through Window and
Worker fetch, Response.clone(), Cache storage and FetchEvent.respondWith().
This preserves CORP checks when a require-corp client receives an opaque
response from a service worker.

Keep public opaque headers empty and immutable, and use the public header
view when matching Vary in Cache. Cover streamed and materialized responses,
opaque redirects, filtered HTTP 206 responses and Vary:* cache roundtrips.

Reject invalid filtered respondWith responses before following their
restored internal Location headers.
2026-11-19 00:30:44 +08:00
ldm0 67f2149eff fix(fetch): keep data URL responses basic across request modes
Apply the data-scheme exception when selecting response filtering and the
observable response type. Data URL origins remain opaque, while no-cors
fetches retain their status, immutable headers and response body.

Cover Window and opaque-origin Worker fetches across request modes,
redirect modes, GET/HEAD/POST, Request clones, URL fragments, MIME types,
binary body reads, response clones and bodyUsed behavior.
2026-11-19 00:30:44 +08:00
ldm0 65737d1204 fix(fetch): reject non-follow cross-origin no-cors requests
Reject cross-origin HTTP(S) no-cors requests with manual or error redirect
mode before transport, CDP interception, or Service Worker dispatch in
Window and Worker fetch. Check the logical URL at the fetch entry point
so a CDP transport URL rewrite retains the original policy decision.

Cover non-redirecting responses, Request clones and init overrides,
local URL fetches, argument and abort precedence, interception ordering,
and Service Worker dispatch counts.
2026-11-19 00:30:44 +08:00
ldm0 3fe6aa7011 fix(fetch): preserve URLs on opaque redirect responses 2026-11-19 00:30:44 +08:00
ldm0 ea4b5edaa8 fix(fetch): preserve redirect mode when filtering responses 2026-11-19 00:30:44 +08:00
ldm0 ec3ce1f651 fix(fetch): enforce CORS checks on every browser redirect
Route Window and Worker Fetch/XHR through per-hop authorization even for
safelisted requests. Reject unauthorized or credentialed cross-origin
redirects before contacting the next URL, strip cross-origin Authorization,
and preserve redirect origin, cookie, network-event and referrer state.

Discard unused preflight and redirect bodies without delaying the final
stream. Give each transfer private cancellation while sharing parent aborts
and only the accepted final response's completion facts. Select manual and
error modes from the redirect status before parsing Location.

Cover 930 Window/Worker Fetch and synchronous/asynchronous XHR scenarios,
including forbidden destination contact and request headers, plus transport
cancellation and referrer-policy regressions.

Validation:
- cargo fmt --all
- cargo clippy --workspace --all-targets --all-features -- -D warnings
- cargo nextest run --no-fail-fast: 18,188 passed, 13 skipped
- 252 CORS/Redirect/XHR WPT cases: 1,603 -> 1,841 passing subtests out of
  2,007, with no newly failing cases or subtests
2026-11-19 00:30:44 +08:00
ldm0 ee194c894e fix(cors): validate complete origin and credentials fields
Combine all matching Access-Control-Allow-Origin and credentialed
Access-Control-Allow-Credentials fields before validating the response.
Empty duplicates and repeated matching values must also fail the CORS check.

Cover ordinary responses, preflight rejection, and responses after preflight
in Window and Worker Fetch plus asynchronous and synchronous XHR.
2026-11-19 00:30:44 +08:00
ldm0 57144f6d4e fix(xhr): honor null and empty response bodies
Share Fetch body filtering with local responses and XHR, complete null-body streams at headers, and preserve replacement request progress when old completions arrive.

Cover Window and Worker response types, synthetic null-body statuses, empty response event order, and request reuse.
2026-11-19 00:30:44 +08:00
ldm0 2159f94a9b 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-11-19 00:30:44 +08:00
ldm0 84f0061a62 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-11-19 00:30:44 +08:00
ldm0 b548c6613f 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-11-19 00:30:44 +08:00
ldm0 708535b78f 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-11-19 00:30:44 +08:00
ldm0 05777a07cc 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-11-19 00:30:44 +08:00
ldm0 710b7ed46f 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-11-19 00:30:44 +08:00
ldm0 9e2b5f4f64 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-11-19 00:30:44 +08:00
ldm0 74488a59de fix(fetch): send zero content length for bodyless PUT requests 2026-11-19 00:30:44 +08:00
ldm0 0fd90bf669 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-11-19 00:30:44 +08:00
ldm0 b43a3952e9 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-11-19 00:30:44 +08:00
ldm0 abe6a2cda1 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-11-19 00:30:44 +08:00
ldm0 3e81512b5b 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-11-19 00:30:44 +08:00
ldm0 747842fbca 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-11-19 00:30:44 +08:00
ldm0 0120c20e6c 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-11-19 00:30:44 +08:00
ldm0 dc75ec6840 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-11-19 00:30:43 +08:00
ldm0 c52556124d 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-11-19 00:30:43 +08:00
ldm0 91b7fa9e01 fix(xhr): serialize document bodies and normalize text charsets 2026-11-19 00:30:43 +08:00
ldm0 d14c38dd46 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-11-19 00:30:08 +08:00
ldm0 93a9c685b3 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-11-19 00:30:08 +08:00
ldm0 ccae0b9a89 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-11-19 00:30:08 +08:00
ldm0 c6fab4cccc 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-11-19 00:30:08 +08:00
ldm0 6aaae71478 fix(streams): disturb source synchronously when piping starts 2026-11-19 00:29:03 +08:00
ldm0 2707ee5776 test(fetch): cover native Response stream clones and headers 2026-11-19 00:29:03 +08:00
ldm0 b1f25ac2e4 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-11-19 00:29:03 +08:00
ldm0 d5a659bb1e 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-11-19 00:29:03 +08:00
ldm0 728e618236 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-11-19 00:29:03 +08:00
ldm0 a3fa9ca991 test(fetch): cover native body consumption stream state 2026-11-19 00:29:03 +08:00
ldm0 58cf820033 fix: validate RequestInit consistently before fetch abort 2026-11-19 00:29:03 +08:00
ldm0 7f41f92689 fix: construct native navigation events in their target realm
Use intrinsic constructors in the Navigation or history entry target realm
for navigate, currententrychange, navigatesuccess, navigateerror and dispose.
Create history entries in their owning window even when methods are borrowed
from another window. Preserve native navigate event trust and construct
navigation abort controllers and trusted abort events through intrinsics.

Add three Browser integration tests covering 14 cross-window, joint-history
and cross-document flows, including throwing public constructor getters.
The same fixture matches Chrome in all 14 flows.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets
--all-features -- -D warnings; cargo nextest run --no-fail-fast
(17918 passed, 13 skipped). The 334-case WPT comparison gains two passing
cases and two subtests without regressions; passed ledger is 9107.
2026-11-19 00:29:03 +08:00
ldm0 3355cc4811 fix: replace iframe src history before load completion
Use the active child Document's native complete-load state when choosing
whether iframe src navigation replaces the current history entry. This
covers parser, DOMContentLoaded, load and pageshow callbacks despite an
already complete readyState, while retaining post-load push behavior.

Add Browser coverage for 14 src assignment and setAttribute flows. Update
two existing history expectations for src changes from iframe load
callbacks, independently confirmed with their HTML fixtures in Chrome.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets
--all-features -- -D warnings; cargo nextest run --no-fail-fast
(17915 passed, 13 skipped). The 222-case WPT comparison gains three passing
cases and three subtests without regressions; passed ledger is 9105.
2026-11-19 00:29:03 +08:00
ldm0 ec77eb586d fix: preserve child history traversal lifecycle
Run cross-document child traversal through the shared unload tree after
its root navigation checks, retaining visibility transitions and one
unload lifecycle per retiring document and descendant.

Apply native Window lifecycle events' legacy Document target override
explicitly, and reset trust for script-dispatched events. Add Browser
coverage for native versus synthetic dispatch, nested history/navigation
roundtrips, and same-document traversal.

Validation: cargo fmt --all; workspace Clippy with all targets/features
and -D warnings; nextest (17913 passed, 13 skipped). 213 WPT cases gained
one passing case and two passing subtests with no regressions. Seven
matching Chrome fixture flows passed.
2026-11-19 00:29:03 +08:00
ldm0 7297a9b777 fix: unload descendant documents during frame navigation
Snapshot retiring frame documents and finish their beforeunload phase before
actual unload delivery. Preserve ancestor unload counters through descendant
callbacks and check exact owners before dispatching further events.

Retain visibility state on the native Document and dispatch trusted, bubbling
visibilitychange events through the host event path. Use native unload
counters to suppress navigation during visibility and ancestor callbacks;
cancel each retiring window's timers after its unload.

Eight Browser integration tests cover 50 scenarios. The 181-case WPT
comparison gains two passing cases and seven passing subtests without
regressions; update the passed ledger to 9,101 cases.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets
--all-features -- -D warnings; cargo nextest run --no-fail-fast
(17,910 passed, 13 skipped). Rebuilt CLI matches the tested WPT binary.
2026-11-19 00:29:03 +08:00
ldm0 9a0b93f469 fix: ignore document stream replacement during unload
Keep a native counter for each unloading Document so open and implicit
write/writeln stream replacement preserve its nodes, listeners and URL.
Scope guards cover nested callbacks and ancestor teardown without blocking
other documents or manually dispatched unload events. Preserve argument
conversion and existing XML/dynamic-markup exception checks.

Add 34 Browser and main-VM regression scenarios. The 154-case WPT comparison
gains one passing case and six passing subtests with no regressions; update
the passed ledger to 9,099 cases.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets
--all-features -- -D warnings; cargo nextest run --no-fail-fast
(17,909 passed, 13 skipped). Rebuilt CLI matches the tested WPT binary.
2026-11-19 00:29:03 +08:00
ldm0 6c3c1cf442 fix: unload javascript URL documents without beforeunload
A child javascript URL string result must unload the old document without
checking whether unloading is canceled. Reuse the existing teardown that
dispatches pagehide, visibilitychange, and unload, and cancels old timers.
Apply it to the target and its descendants, capturing document identities
before callbacks can remove or replace them.

Add three Browser integration tests covering 12 scenarios, including
nested frames, unrelated frames, non-string completion, ordinary
navigation, and attempts to navigate or schedule timers during unload.
Record the newly passing javascript-url-no-beforeunload WPT.

Validation: cargo fmt --all; workspace all-targets all-features Clippy
with -D warnings; cargo nextest run --no-fail-fast (17,904 passed,
13 skipped). Focused WPT: 110 cases, one new pass / two passing subtest
gains, no regressions.
2026-11-19 00:29:03 +08:00
ldm0 dceebe137b fix: preserve child navigations started by javascript URLs
Check the navigation load as well as the Document owner before committing
a javascript URL string result. A form submission or Location navigation
started during script execution must keep its pending request.

Add four Browser integration tests covering 13 scenarios, including GET,
POST, named targets, successor javascript URLs, unrelated frames, and
canceled navigation. Record the newly passing jsurl-form-submit WPT.

Validation: cargo fmt --all; workspace all-targets all-features Clippy
with -D warnings; cargo nextest run --no-fail-fast (17,901 passed,
13 skipped). Focused WPT: 103 cases, one new pass, no regressions.
2026-11-19 00:29:03 +08:00
ldm0 c4ebccfb9f fix(forms): preserve submission-time navigation history 2026-11-19 00:29:03 +08:00
ldm0 856461e91b fix(navigation): replace Location entries until document loading completes
Track complete loading separately from readyState for main and child documents, retaining the state through document.open(). Apply before-load replacement to Location assignments with the transient user activation exception, and settle inherited main load completion after a load-callback rewrite.

Keep Window.open on the generic navigation path so its history behavior remains independent of the Location API.

Cover real child history length and entry indices across parser, DOMContentLoaded, load, pageshow, and post-load document.open(), plus main navigation event classification and activation. Update the measured Location WPT results.
2026-11-19 00:29:03 +08:00
ldm0 29b6a70f55 fix(html): retain child parser EOF during script execution 2026-11-19 00:29:03 +08:00
ldm0 16aae67252 fix(script): keep parser async work runnable after EOF
Async scripts still fetching at parser EOF previously entered a queue
behind DOMContentLoaded, allowing a slow defer script to block a ready
async script or its error event. Transfer remaining async work to the
exact Document runtime producer and publish each task when its source
completes, retaining its load-delay lease.

Preserve observed async completion order across parser handoff. Add gated
success, failure, and out-of-order completion tests, and update the WPT
ledger for execution-timing/085.html.

Validation:
- cargo fmt --all
- cargo clippy --workspace --all-targets --all-features -- -D warnings
- cargo nextest run --no-fail-fast: 17,879 passed, 13 skipped
- 270 WPT cases: 257 to 258 passes, no case or subtest regressions
2026-11-19 00:29:03 +08:00
ldm0 09a3448d4a fix(html): queue child load delivery through the DOM source
Queue iframe load delivery alongside other DOM tasks and include current
child lifecycle owners in the existing lifecycle scheduling preference.
This keeps initial load ahead of module timers that replace the document.

Cover inline, imported, external, and top-level-await modules using parent
and child timers. Check adopted-image events against the shared DOM FIFO.
Update the WPT ledgers for the three repaired delayed module-write cases.

Validation:
- cargo fmt --all
- cargo clippy --workspace --all-targets --all-features -- -D warnings
- cargo nextest run --no-fail-fast: 17,875 passed, 13 skipped
- 270 WPT cases: 254 to 257 passes, no case or subtest regressions
2026-11-19 00:29:03 +08:00
ldm0 6553df28c8 fix(html): queue document lifecycle transitions on the DOM source
Admit DOMContentLoaded and main Window load after their parser/defer and load
prerequisites so earlier DOM tasks keep their FIFO positions. Keep interactive
readiness at parser stop, preserve child realm prerequisites, and return a load
boundary to its driver if an earlier DOM callback adds a new load delay.

Queue parser-owned external import-map errors during preparation, including
child and document.write parsers, so later dynamic errors cannot overtake them.
Cover ordering, replacement and load-delay behavior in main and child documents.

Validation:
- cargo fmt --all
- cargo clippy --workspace --all-targets --all-features -- -D warnings
- cargo nextest run --no-fail-fast: 17,871 passed, 13 skipped
- 270 WPT cases: 254 pass, 10 fail, 5 timeout, 1 error; one new pass and
  no case-status or passing-subtest-count regressions
2026-11-19 00:29:03 +08:00
ldm0 c8f2a7ea52 fix(canvas): settle ImageBitmap promises through bitmap tasks
Reject Web IDL conversion errors through the returned Promise and decode
raster Blobs from their bytes on the blocking pool. Deliver results through
a dedicated bitmap task source bound to the exact Page and Window realm.

Retain canvas, ImageData and ImageBitmap pixel snapshots for crop, resize,
flip and alpha processing. Clear pixels on close and reject closed sources
in drawImage. Read HTML canvas dimensions from native attributes.

Cover Promise timing, pixels, intrinsic prototypes, child realm retirement,
document.open and real navigation identity collisions with Page task tests.
2026-11-19 00:29:03 +08:00