Commit Graph
4342 Commits
Author SHA1 Message Date
ldm0 c1953283e2 fix(indexeddb): validate schema key paths and exception ordering
Validate key paths and schema options in the backend before metadata writes.
Preserve method-specific precedence for duplicates, syntax and option errors,
and use native transaction mode together with activity and deletion state.

Check receivers and required arity before conversion, consume iterable key
paths once, and read IDB dictionary members in WebIDL order. Keep synchronous
schema exceptions in the callee realm while mutating the store in its owner
realm.

Cover native metadata rejection, argument parsing and Window/iframe/Worker
behavior. Record eight newly passing official IndexedDB WPT cases.
2026-11-24 14:30:19 +08:00
ldm0 a35d503c1e fix(indexeddb): propagate request events and abort failed transactions
Reuse EventTarget listener dispatch for request, transaction and database
capture/bubble paths, ordered handler properties, listener options and callback
cleanup. Keep event parents private so author properties cannot change them.

Abort active transactions after uncanceled request errors or thrown listeners,
while preserving the original request error and giving pending requests fresh
AbortErrors. Keep committing transactions inactive, reject further commit/abort
calls, and abort committing request failures before their error notifications.

Cover event order, cancellation, listener exceptions, microtasks, explicit commit
and persisted data in Window, child and Worker regressions. Record 16 additional
complete official WPT passes.

Validation: fmt, strict workspace Clippy, and 19,159 nextest tests passed.
Official WPT sample: 54 -> 70 passes out of 78, without regressions.
2026-11-24 14:30:19 +08:00
ldm0 46509feba9 fix(indexeddb): validate transaction creation across upgrade boundaries
Convert store names before the mode enum and read iterator methods once.
Use the generated receiver and required-argument checks. Reject live
upgrades, closing connections, missing stores and empty scopes before
creating or queuing transactions; reject versionchange after those checks.
Normalize transaction scopes to unique names.

Reserve the open result before upgrade-complete callbacks can enqueue
regular transaction results. Keep request.transaction until complete
returns and still check for a closed connection when delivering open.

Exercise Window, iframe and Worker through the production browser event
loop, including getter errors, pending transactions and upgrade state
boundaries. Record newly passing upstream WPT variants after verification.
2026-11-24 14:30:19 +08:00
ldm0 5c22288fd5 fix(indexeddb): coordinate connections across Window and worker agents
Discover connections through the shared manager and deliver versionchange
notifications through each owning event loop. Acknowledge notifications after
their microtask checkpoints and retain the resulting blocked-event decision
when a later timer closes the connection.

Keep closing connections alive until accepted transactions finish, including
transactions awaiting their backend start. Abort transactions and release
connection requests when a worker exits. Keep borrowed database operations
in the connection's realm while preserving the callee's exception realm.

Count transaction requests only after an operation is accepted, so synchronous
validation errors cannot leave closing connections waiting on phantom work.

Cover Window/Worker and two-worker notifications, close-pending transactions,
cross-realm methods, worker termination, rollback and retired requesters.
2026-11-24 14:30:19 +08:00
ldm0 5429639793 fix(parser): adapt WPT paths to shared parser state
Preserve owner interruptions during deferred script preparation and use the
current HTML stream and custom-element construction interfaces. Restore
body/window content-handler registration on the new child insertion path and
remove mutation adapters superseded by the shared parser lifecycle.

Validation: cargo fmt --all; strict all-feature workspace Clippy; cargo nextest
run --no-fail-fast (19,128 passed, 13 skipped). The nine child handler regressions
also pass in a focused run.
2026-11-24 14:30:19 +08:00
ldm0 4a2a070fa4 fix(events): share AbortSignal EventTarget dispatch
Use inherited EventTarget methods and the shared listener registry for window and worker signals. Preserve ordered onabort handlers, cancellation options, listener mutation, and receiver validation while keeping abort algorithms with their existing owners.

Remove the duplicate dispatchers and tighten the raw callback inventory. Cover cross-realm bindings, retired targets, native abort delivery, and worker receivers.
2026-11-24 14:30:19 +08:00
ldm0 ee733c7016 test(wpt): remove regressions duplicated by main 2026-11-24 14:30:19 +08:00
ldm0 24a04caf20 fix(runtime): adapt WPT paths to shared script execution 2026-11-24 14:30:19 +08:00
ldm0 5937742d8e test(blob): verify captured entries bypass request interception 2026-11-24 14:30:19 +08:00
ldm0 350fbd7a3d fix(events): preserve cleanup for host-dispatched child events 2026-11-24 14:30:19 +08:00
ldm0 e86e3aef89 fix(messaging): preserve MessagePort document lifecycle
Create detached branded ports from retained constructors, retire stale owners
before transfer, and reject manual dispatch on retired receiver realms after
validating Event state. Capture postMessage destinations after argument
conversion and before serialization so reentry cannot revive old connections
or cancel an already selected live destination.

Cover constructor realms, frame reinsertion, endpoint cleanup, borrowed
dispatch, transfer and serialization reentry.
2026-11-24 14:30:19 +08:00
ldm0 0188020c49 fix(events): share MessagePort EventTarget dispatch 2026-11-24 14:30:19 +08:00
ldm0 5251ad7ac9 fix(events): route borrowed Window EventTarget methods
Capture Window execution bindings before argument conversion and dispatch in
the receiver realm. Borrowed add/remove/dispatch methods now use the receiver's
listener list and currentTarget, reject cross-origin access before conversion,
and cannot retarget a replacement Window after a getter navigates or removes it.

Cover parent/child realm routing, receiver replacement during conversion,
cross-origin checks, and borrowed Window onerror dispatch.
2026-11-24 14:30:19 +08:00
ldm0 1097590489 fix(events): preserve original Window onerror data 2026-11-24 14:30:19 +08:00
ldm0 3f8f413e51 fix(events): dispatch worker onerror through ordered listeners 2026-11-24 14:30:19 +08:00
ldm0 5dadf3f269 fix(events): report worker listener exceptions once 2026-11-24 14:30:19 +08:00
ldm0 a7f68bf304 fix(events): preserve object-valued handlers on simple targets
Keep legacy EventHandler object values and their listener registration position
across page, popup and worker targets. Invoke non-callable handler objects as
no-ops while retaining callback-interface behavior for ordinary listeners.

Cover cross-realm identity, proxy callability, native dispatch and worker
surfaces, and correct obsolete object-to-null assertions in local fixtures.
2026-11-24 14:30:19 +08:00
ldm0 c3e5429e98 fix(events): preserve listener mutations during dispatch
Track the exact registration represented by each dispatch snapshot and
refresh active handlers before invoking them. Removing and re-adding the
same callback no longer revives an entry from the current snapshot, while
handler replacements use their current value and callback contexts.

Share invocation preparation across simple event targets, worker threads,
and Worker/SharedWorker host error dispatch. Remove once listeners before
calling author code so a reentrant registration remains active.

Cover listener replacement, abort, object callbacks, nested dispatch,
realm retirement, and actual worker message and error delivery.
2026-11-24 14:30:19 +08:00
ldm0 3ff32f9834 fix(events): preserve DOM handler object values
Keep object values in DOM and Window event handler slots and convert
primitives to null. Distinguish legacy handlers from EventListener
callbacks so non-callable handlers return undefined without looking up
handleEvent, retaining listener order and surviving object-realm retirement.

Cover callable and revoked proxies, child windows, handler object lifetime,
and special Window callbacks. Update older assertions to check object
identity separately from primitive clearing.
2026-11-24 14:30:19 +08:00
ldm0 f5a75045ce fix(events): preserve handler mutations during compile errors 2026-11-24 14:30:19 +08:00
ldm0 52e11b016a fix(events): register child Window content attribute handlers
Route body and frameset attributes through the child Window listener
registry, including parser insertion and HTML fragments. Compile lazily
in the child realm
while preserving error arguments, listener order and reentrant changes.

Replace the special onload/onstorage paths so clearing an IDL handler
does not reactivate its content attribute. Cover parser startup, empty
handlers, syntax errors, dispatch mutations and document replacement.
2026-11-24 14:30:19 +08:00
ldm0 ee944ea468 fix(workers): keep module workers alive after evaluation errors 2026-11-24 14:30:19 +08:00
ldm0 7c9ab41694 fix(modules): parse JSON before evaluating module graphs
Parse JSON while creating document and worker module records, before any
sibling module executes. Cache the parsed default export and preserve the
original parse exception across concurrent and repeated imports.

Retain JSON response URLs as private host metadata without replacing a
later JavaScript throw location. Avoid preparing author stacks during JSON
module creation, and preserve native Worker compile errors while retaining
existing bootstrap fallback error kinds.
2026-11-24 14:30:19 +08:00
ldm0 a6a3e0cdf7 fix: adapt rebased scripts and viewport tests to main APIs
Use each script request identity for Accept-Language and client hints in the metadata fallback path. Cover request overrides across script kinds and redirect targets. Initialize newly added viewport fields and format the merged visibility predicate.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast (18710 passed, 13 skipped).
2026-11-24 14:30:19 +08:00
ldm0 0ba258b047 fix(script): require supplied JavaScript MIME for strict loads 2026-11-24 14:30:19 +08:00
ldm0 145050f654 fix(service-worker): implement registration update jobs 2026-11-24 14:30:19 +08:00
ldm0 670bf06fd7 fix(service-worker): persist classic script resource maps
Reuse each version's main and imported script sources across repeated imports, worker restarts, and profile restoration. Keep full request URLs as map keys and freeze new imports after the install event settles.

Preserve decoded sources, muted errors, redirect checks, and installed main-script policies. Recover legacy metadata only when fetched bytes and final URLs still match. Cover install timing, redirect aliases, fragments, failed evaluation, retries, and offline restarts.
2026-11-24 14:30:19 +08:00
ldm0 8c57590c25 fix(csp): block importScripts redirects before network contact
Carry owned worker policies and the importer location into per-request
redirect checks, including cached redirect responses. Queue an event for
each violated policy while preserving the original request URL and
synchronous NetworkError behavior.

Verify server contact counts, current-policy checks on cached redirects,
multiple enforced/report-only policies, and asynchronous report fields.
2026-11-24 14:30:19 +08:00
ldm0 26ee9c98d9 fix(csp): correct importScripts policy checks and events
Use script-src-elem with script-src/default-src fallbacks for imported
classic scripts. Queue Worker CSP violations after the current task while
preserving the importer's sanitized source location and synchronous
NetworkError behavior.

Cover late listeners, microtask ordering, directive precedence, imported
callsites, and report-only behavior in dedicated and shared workers.
2026-11-24 14:30:19 +08:00
ldm0 b6bc95964f fix(csp): enforce worker string timer policies
Apply the worker eval CSP gate to setTimeout and setInterval string
handlers, return zero when blocked, and preserve report-only execution
and Trusted Types policy rules.

Convert handler and delay arguments before policy checks. Propagate
conversion exceptions without scheduling a timer or invoking a default
Trusted Types policy. Cover function callbacks, report samples, and
TrustedScript/default-policy behavior.
2026-11-24 14:30:19 +08:00
ldm0 39bbb327b9 fix(csp): inherit creator policies in local workers
Carry header, meta, and report-only policies into blob/data dedicated,
shared, and nested workers while retaining their self origin and report
rules. Keep blob URLs linked to their creating environment until worker
startup, then clone the policies for the worker lifetime.

Preserve nested HTTP worker response policies and cover local worker
requests, reporting metadata, and object URL metadata lifetimes.
2026-11-24 14:30:19 +08:00
ldm0 e362807f00 fix(csp): block fetch redirects before network access 2026-11-24 14:30:19 +08:00
ldm0 109f46c63d fix(csp): report fetch call locations and original redirect URLs
Capture script locations for synchronous Window and Worker fetch violations.
Leave locations absent for asynchronous redirects and report the original
request URL, retaining the initiating document's report authority.
Omit unknown source-file values from legacy reports and cover location-based
deduplication, redirect privacy, and report ownership.
2026-11-24 14:30:19 +08:00
ldm0 776bdb8c41 fix(webidl): isolate WindowProperties proxy trap lookup
Give WindowProperties and HTML constructor proxy handlers a null prototype
so inherited page properties cannot intercept named element lookup.
Cover inherited trap functions/getters and numeric prototype shadowing in
both main and child windows.
2026-11-24 14:30:19 +08:00
ldm0 05bf10fd46 fix(csp): deduplicate reports per document and worker 2026-11-24 14:30:19 +08:00
ldm0 5a82a70654 fix(csp): enforce frozen document base URL policies 2026-11-24 14:30:19 +08:00
ldm0 496df1e678 fix(modules): preserve runtime failure ordering
Keep failed ordered modules at their insertion position and allow ready async
failures to report without waiting for later graph fetches. Preserve error
readiness across scheduler checks and register graph-start failure fanout in
its original order.

Validate mixed script ordering, pending fetches, and shared failure dispatch.
All workspace fmt, Clippy, and nextest checks pass (18,429 tests; 13 skipped).
Browser comparison passes 96 probes and 21 WPT files (56 subtests).
2026-11-24 14:30:19 +08:00
ldm0 9b9e661c2a fix(scripts): execute dynamic child modules in insertion order 2026-11-24 14:30:19 +08:00
ldm0 5942b1a117 fix(scripts): skip execution after cross-document adoption
Check each prepared script's node Document before executing or reporting a
source failure, while settling its original ordering and load-delay ownership.
Apply the check to main-document classic/module and child-document script work.

Keep terminal events for scripts adopted during execution, and allow existing
top-level-await evaluations to continue. Cover removal, adoption, moving back,
source failures, child lifecycle completion, and adoption after evaluation starts.
2026-11-24 14:30:19 +08:00
ldm0 ef02af6d9b fix(realms): unwrap bound function and Proxy targets
Bound functions wrapping foreign proxies can have a creation context that differs from the underlying target realm. Expose V8 GetBoundFunction and follow both internal target chains when resolving a callable realm, including revoked-Proxy errors without executing property traps.

Cover mixed chains, prototype mutation, revoked proxies, all eight Wasm constructors, and DOMParser prototype fallback with unchanged document ownership and getter counts.

Validation: cargo fmt --all; strict workspace/all-targets/all-features Clippy; full nextest (18,417 passed, 13 skipped); CLI build; 17/17 selected WPT passed. The Wasm NewTarget realm WPT improves from 112/120 to 120/120 subtests.
2026-11-24 14:30:19 +08:00
ldm0 4059bc2be2 fix(wasm): preserve child intrinsic prototype identity
Reuse the child V8 intrinsic instance prototypes behind the public WebAssembly constructors so native exceptions, async compilation results and imported modules retain constructor and instanceof identity. Keep the existing Function and NewTarget realm adapter.

Add native CompileError, LinkError and RuntimeError regressions, realm isolation and descriptor checks, and an HTTP module error identity assertion.

Validation: cargo fmt --all; strict workspace/all-targets/all-features Clippy; cargo nextest run --no-fail-fast (18,416 passed, 13 skipped); CLI build; API and WPT baseline comparisons.
2026-11-24 14:30:19 +08:00
ldm0 1f9d9b77da fix(modules): load and evaluate Wasm in child documents
Carry the parser-root module kind into fetching and compilation so child
Wasm responses retain their binary bytes. Keep resolved evaluation inputs
with the compiled records and use exact context/module lookup for Wasm
and its dependencies, including evaluation resumed after async work.

Cover real child HTTP loading, invalid bytes, context isolation, identity
hash collisions and record disposal. Full fmt, strict workspace Clippy and
18,415 nextest tests pass. Runtime scenarios improve from 28/40 to 40/40;
iframe execute-start and wasm-import-wasm-export WPT cases now pass.
2026-11-24 14:30:19 +08:00
ldm0 6558af8a35 fix(modules): preserve error constructors through module trees 2026-11-24 14:30:19 +08:00
ldm0 c59ba2c135 fix(modules): preserve caught TypeError constructors 2026-11-24 14:30:19 +08:00
ldm0 f3dbb741a0 test(wpt): reconcile case lists after main rebase
Restore the _self and input button passing entries lost during replay and
classify the history back noop case as harness-stalled, matching fresh Moli
results. Keep one classification per case across all 12,936 entries.

Compared eight affected and related pages with the rebased Moli binary and
Chromium. execution-timing/102 still reports a harness timeout in both.
2026-11-24 14:30:18 +08:00
ldm0 09759d79dc fix(cssom): retain link sheets until replacement loads
Keep the installed owner source and JavaScript sheet while a valid link
attribute change starts a successor load. Preserve existing CSSOM edits and
prevent URL-cache hydration from replacing the current sheet prematurely.

Replacement responses detach the old sheet at installation; integrity rejection
retains it. Cover successful and failed loads, source bindings, and removal
before a queued successor response settles.
2026-11-24 14:30:18 +08:00
ldm0 e599a8a0bc fix(stylesheet): enforce integrity before CSSOM installation
Validate raw stylesheet response bytes and response eligibility through the
shared SRI verifier. Preserve integrity rejection in fetch terminals so failed
loads dispatch error and release their load delay without installing a sheet
or discovering imports.

Require links with integrity metadata to use the compatible fetch cache instead
of hydrating an unverified parsed source by URL. Add regressions for hashing,
CORS, service-worker filters, local data URLs, redirects, and cached loads.
2026-11-24 14:30:18 +08:00
ldm0 7672caf9e5 fix(csp): match wildcard ports on exact hosts
Handle exact-host sources with :* in the CSP matcher instead of sending them
to URL parsing. Preserve scheme, host, path, and redirect restrictions while
rejecting invalid literal host sources.

Add coverage across resource kinds and source restrictions. Record the image
and script wildcard-port WPT files as passing, and record the two SRI files
with remaining partial-integrity failures as failing.

Validation: cargo fmt --all; workspace clippy with all targets/features and
-D warnings; full nextest (18,367 passed, 13 skipped); 69 focused CSP tests.
23 WPT cases improved from 79/94 to 86/94 subtests without new failures.
All 18 HTTP port probes match Chromium, including blocked-request counts.
2026-11-24 14:30:18 +08:00
ldm0 10f6465467 fix(forms): preserve popup navigation source and referrer
Use the shared element navigation path for GET form popup submissions so the
new document retains its creator URL, policy container, and rel semantics.
Resolve child-window creators from the form's owner document, and remove the
obsolete popup path that carried only the opener flag. Apply Referrer Policy
and sanitize the source URL, honoring anchor/area policy overrides.

Exercise all seven rel combinations for form, button, and input submissions
from both top-level and HTTP-loaded iframe documents, plus cross-origin
referrer policy and fragment stripping. Record the three newly
passing form popup WPT cases.
2026-11-24 14:30:18 +08:00
ldm0 0168423d56 fix(input): preserve document ownership in empty iframe viewports
Use a generated document root as the viewport input fallback, retaining the
child document and coordinate transform when an iframe has no hittable box.
Keep mouse input suppressed for roots without a box while allowing inspectors
and wheel events to target the owning Document.

Chain wheel input through embedding frames only when the child cannot consume
it, and respect overscroll containment. Cover empty, excluded and removed roots,
nested and transformed frames, viewport bounds, and wheel scroll boundaries.
2026-11-24 14:30:01 +08:00