Commit Graph
22 Commits
Author SHA1 Message Date
ldm0 e97c8287ce fix(fetch): preserve service worker response types and CORS headers
Carry the original response filter and validation state through Window
streams and Worker completions, including paused responses. Synthesized
responses remain basic, and already fetched bodies are not filtered by ORB
again. Keep client CORP/COEP checks against actual network response URLs.

Retain internal headers separately from the CORS public header view through
clone, deferred Cache.put, persistent Cache storage and respondWith. Match
Vary using the public header view and keep filtered cached headers immutable.
2026-09-27 06:43:23 +08:00
ldm0 f71695e10d fix(html): retain child parser EOF during script execution 2026-09-27 06:43:21 +08:00
ldm0 5ee47ac069 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-09-27 06:43:21 +08:00
ldm0 0e0f6dfa8f 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-09-27 06:43:21 +08:00
ldm0 0cc94c4915 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-09-27 06:43:21 +08:00
ldm0 e27217061b fix(parser): checkpoint microtasks before preparing parser scripts
Yield live HTML script preparation to the document owner after releasing
parser borrows. Prepare from the current DOM after the guarded microtask
checkpoint, and abandon stale handoffs when that checkpoint replaces the
document. Apply the boundary to main documents, child documents, and
document.write; preserve eager parsing when no runtime owner is installed.

Admit parser async classic scripts after preparation and keep nested
script cleanup from draining microtasks while an outer script is running.
Add main/child integration coverage and update the two repaired WPT cases.

Validation:
- cargo fmt --all
- cargo clippy --workspace --all-targets --all-features -- -D warnings
- cargo nextest run --no-fail-fast: 17,846 passed, 13 skipped
- 245 related WPT cases: all 231 previously passing cases remain passing
- Final CLI build: both repaired WPT cases pass on the validated sources
2026-09-27 06:43:21 +08:00
ldm0 7f1b6fc14d fix(script): checkpoint microtasks during event callback cleanup
Perform HTML script cleanup between event callbacks when the execution-context stack becomes empty, retaining currentTarget, passive state, and window.event through the checkpoint. Preserve script execution scopes during exception reporting, use the same callback boundary for Worker.onerror, and guard the complete microtask checkpoint against reentrancy.

Remove deferred window.event restoration. Update callback-order assertions and asynchronous fixtures to wait for the final event they inspect, while retaining scheduler, document-owner, and follow-up checks. Add Window, child Window, and Worker coverage for nested dispatch, listener removal in microtasks, and script versus callback exceptions.

Callback exception ordering follows Web IDL cleanup before rethrow; the local Chromium probe reports the error before that checkpoint.

WPT: 3 additional passes in the script-element microtask tests; the other 492 cases retain identical statuses and subtest results. Update the corresponding passed/failed case lists.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast (17,843 passed, 13 skipped). Fresh CLI build SHA-256 matches the binary used for the 495-case WPT comparison.
2026-09-27 06:43:21 +08:00
ldm0 c32a09298f fix(script): retain child parser state during script cleanup
Run classic script microtasks before restoring currentScript or releasing child parser nesting. Defer nested checkpoints to the outer script and wait for exception reporting before running reactions.

Cover inline and external scripts, syntax and runtime errors, document.open/write insertion points, and nested execution. Record the repaired synchronous-script bailout WPT.
2026-09-27 06:43:21 +08:00
ldm0 39359763f1 fix(document): ignore destructive writes during module execution
Track nested ignore-destructive-writes counters per Document across module evaluation and its cleanup checkpoint. Preserve explicit input streams, cross-realm Document identity, and writes from later tasks or pending top-level await continuations.

Validate root and child module behavior with five regression tests. The 149-case dynamic-markup WPT run gains four passes with unchanged remaining outcomes; update their recorded case status. cargo fmt, workspace all-feature clippy, and all 17835 nextest tests pass.
2026-09-27 06:43:21 +08:00
ldm0 b5dc26c0ac fix(document): reject XML child input-stream operations
Validate native Document type before parser and navigation bailouts, and preserve argument conversion before write and writeln state checks. Cover XML MIME types, side effects, exception realms, parser scripts, unload callbacks, and custom-element constructor ordering.
2026-09-27 06:43:21 +08:00
ldm0 b918999b33 fix(document): reset child input-stream readiness 2026-09-27 06:43:21 +08:00
ldm0 cf7e6e8b3e fix(document): initialize child navigation readiness 2026-09-27 06:43:21 +08:00
ldm0 6fcfd2c32f fix(scripts): restore child parser insertion point on fetch errors 2026-09-27 06:43:21 +08:00
ldm0 7db961ac15 fix(scripts): queue parser preparation error events
Distinguish empty or invalid external script URLs from internal parser preparation failures. Queue trusted element errors on the shared DOM-manipulation source for root, document.write, and child parser paths without reporting spurious Window exceptions.

Retain exact Document ownership, listener checkpoints, and already-started state. Cover stale tasks and reused PageVm-local ids, and record the two WPT cases verified in CLI and CDP modes.
2026-09-27 06:43:21 +08:00
ldm0 8e4f7f0a6d fix(modules): bind synthetic text sources to their owning records
Resolve JSON and CSS evaluation data by exact module identity in the compiling realm, with weak context entries owned by compiled records. Remove the main-Document source lookup that broke child imports.

Cover static and deferred dynamic child imports, realm-local caches, parse errors, identity collisions and record disposal. Mark both JSON/CSS cross-origin WPT cases passing after CLI/CDP verification.
2026-09-27 06:43:21 +08:00
ldm0 e53b60bd7c fix(sri): retain supported hashes with malformed padding 2026-09-27 05:46:50 +08:00
ldm0 24743af0e4 fix(script): report document.write exceptions through shared execution 2026-09-26 20:22:11 +08:00
ldm0 4a1e6fd196 fix(fetch): unify script headers and CORS response validation
Generate Origin independently of browser destination metadata, and attach script
metadata at classic, module, and preload request builders. Share redirect URL-list
rules across request generation and response validation, and remove final-only
CORS validation from manifests, stylesheets, and request interception.

Reject failed CORS checks even without supported integrity metadata. Preserve CSP
reporting before dynamic script fetches and use committed Window origins for
srcdoc and sandboxed child script/module requests.

Add wire-level Origin, Cookie, and Fetch Metadata regressions, plus manifest,
stylesheet CSSOM, CSP, and child module/preload coverage.
2026-09-13 04:46:51 +08:00
ldm0 b63197ff8a fix(fetch): retain redirect state across service worker fallback
Keep redirect history in Request so Service Worker handoffs, network
redirects, preflights, Origin serialization, cookies, and TLS credentials
share the same state. Avoid reusing another request's response URL list
from the renderer memory cache.

Validate and filter network responses using their full history while
preserving readable Service Worker response filters across streaming and
buffered delivery. Returning to the initiating origin keeps network CORS
tainting; worker-produced responses retain their own filtering.

Add wire-header, credentials, cache, and worker response regressions, and
correct the local Fetch/XHR redirect fixtures to authorize and expose CORS
responses after a cross-origin round trip.
2026-09-13 04:46:51 +08:00
ldm0 c1412b76b9 fix(fetch): preserve redirect response provenance
Distinguish network, service worker, and browser-internal redirects so synthetic responses are not subjected to network CORS checks. Preserve every hop for redirect taint and Origin validation, including across navigation response conversions.

Add seven cross-origin service worker script scenarios and guard CORS checks for cached network redirects without ExtraInfo. The new integration regression fails before the fix and passes afterward.

Validated with cargo fmt --all, workspace Clippy across all targets and features with warnings denied, and cargo nextest run --no-fail-fast: 17459 passed, 13 skipped. Used one build job for the full test run after a parallel-build rustc process was killed.
2026-09-13 04:46:51 +08:00
ldm0 a4364bf149 fix(scripts): validate response eligibility before SRI
Preserve response filtering through script and service worker loading, validate CORS authorization across redirects, and reject opaque responses before computing supported integrity digests. Keep empty and unsupported metadata behavior unchanged.

Add parser, dynamic script, module, and service worker regressions covering 39 scenarios. Validated with cargo fmt --all, full workspace Clippy, and cargo nextest run --no-fail-fast (17457 passed, 13 skipped).
2026-09-13 04:46:51 +08:00
ldm0 14949fd862 fix(dom): include CDATA in child text content
Extract an independently mergeable topic from wpt-misc-fix at
a70a96f9d1.

Register the child text content regression module without including later script test modules.
Include the XML document fixture route used by the CDATA regression so this branch does not depend on the separate XML input-stream changes.

Source commits:
- 7f587e1251
- ae3a3f1096

Validation:
- cargo fmt --all
- cargo clippy --workspace --all-targets --all-features -- -D warnings
- cargo nextest run --no-fail-fast
2026-09-10 05:50:52 +08:00