Commit Graph
1568 Commits
Author SHA1 Message Date
ldm0 c19aebae87 test(wpt): record IndexedDB upgrade lifecycle passes 2026-09-23 09:13:04 +08:00
ldm0 8f924d9c57 fix(indexeddb): wait for upgrade requests before completing open 2026-09-23 09:13:04 +08:00
ldm0 119b8769c2 test(wpt): record passing IndexedDB upgrade rollback cases
Record only complete official testharness cases verified against the final
Moli build and Chromium, including window and dedicated worker variants.
2026-09-23 09:13:04 +08:00
ldm0 922a9d8d2f fix(indexeddb): restore upgrade metadata and handle state on abort
Expose the requested version on provisional connections, snapshot the prior
schema, and synchronously restore database/transaction/store metadata on abort.
Track created and deleted store/index handles so replacements with the same
name are not revived. Use native transaction ownership during rollback.

Keep the open request transaction through its abort event, then queue the open
failure. Share deletion checks across store/index requests and sort IDB name
lists by UTF-16 code units.

Cover initial and existing upgrades, schema/data rollback, retained handles,
same-name replacements, author property getters, and abort event ordering.
2026-09-23 09:13:04 +08:00
ldm0 9237fe6907 test(wpt): reconcile case classifications after main rebase
Keep incoming main's classification for the three cases that appeared in
multiple result lists after history replay. Ensure all case lists remain sorted
and mutually exclusive.
2026-09-23 09:12:25 +08:00
ldm0 be5cd0e997 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-09-23 09:12:25 +08:00
ldm0 1ae3a5ee58 fix(dom): use intrinsic AbortSignal factories and WebIDL arguments
Create window and worker signals in the callee realm independently of static method receivers and mutable globals. Share typed timeout and signal-sequence conversion, preserving original iterator exceptions and native interface branding.

Carry full-width millisecond delays through the timer scheduler. Cover numeric boundaries, arbitrary receivers, global replacement, cross-realm creation, worker timeout delivery, and long deadlines; remove the obsolete direct iterator-call allowances.
2026-09-23 09:12:25 +08:00
ldm0 27f0867d9a 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-09-23 09:12:09 +08:00
ldm0 71eb9cb7f0 fix(events): connect MediaQueryList to EventTarget bindings
Inherit the shared EventTarget methods and native receiver checks, retain ordered onchange listeners, and use the target realm for borrowed matches getters. Cover cross-realm receivers, dispatch validation, listener ordering, and retired iframe targets.
2026-09-23 09:11:47 +08:00
ldm0 ae98e13106 fix(wpt): unify overlapping fixture handlers after rebase 2026-09-23 09:11:47 +08:00
ldm0 30c7252b7a test(wpt): remove regressions duplicated by main 2026-09-23 09:11:47 +08:00
ldm0 f71bbf37e6 fix(runtime): adapt WPT paths to shared script execution 2026-09-23 09:11:47 +08:00
ldm0 1326c9e3f4 test(blob): verify captured entries bypass request interception 2026-09-23 09:11:47 +08:00
ldm0 464033c1b8 fix(dom): preserve isolated realms in document factories 2026-09-23 09:11:47 +08:00
ldm0 bc60e3b7ee fix(events): preserve cleanup for host-dispatched child events 2026-09-23 09:11:47 +08:00
ldm0 483fa4d8ca 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-09-23 09:11:31 +08:00
ldm0 37a7206260 fix(events): share MessagePort EventTarget dispatch 2026-09-23 09:11:14 +08:00
ldm0 38eafa4f29 fix(events): preserve listener option conversion errors 2026-09-23 09:10:49 +08:00
ldm0 2080fe6c8b 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-09-23 09:07:28 +08:00
ldm0 e3a7abc825 fix(events): preserve original Window onerror data 2026-09-23 09:07:28 +08:00
ldm0 241f570635 fix(events): dispatch worker onerror through ordered listeners 2026-09-23 09:07:28 +08:00
ldm0 fef1ba4a73 fix(events): report worker listener exceptions once 2026-09-23 09:06:58 +08:00
ldm0 9d4ca0a6bc 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-09-23 09:06:46 +08:00
ldm0 e288153be9 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-09-23 09:06:46 +08:00
ldm0 d0b0adcd27 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-09-23 09:06:46 +08:00
ldm0 3cd14825d5 fix(events): preserve handler mutations during compile errors 2026-09-23 09:06:17 +08:00
ldm0 683f767c54 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-09-23 09:06:17 +08:00
ldm0 b2ef133d8f fix(workers): keep module workers alive after evaluation errors 2026-09-23 09:06:17 +08:00
ldm0 faf6f4346b fix(workers): dispatch intrinsic bootstrap error events
Use trusted plain Events with default flags for worker loading, parsing,
and SharedWorker connection failures, without invoking author constructors
or exposing ErrorEvent-only details.

Keep nested bootstrap failures out of runtime error propagation. Cover
native event construction, author hooks, CSP blocking, callback ordering,
and startup-versus-runtime behavior in Rust and ported WPT fixtures.
2026-09-23 09:06:17 +08:00
ldm0 f11fddf78d 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-09-23 09:06:17 +08:00
ldm0 96cffd0d68 fix(wpt): serve JSON module lifecycle fixtures 2026-09-23 09:06:17 +08:00
ldm0 3042091894 fix(wpt): parse fixture response pipes like wptserve 2026-09-23 09:06:17 +08:00
ldm0 6c3f776f06 fix(modules): validate JSON and CSS response MIME
Reject Window JSON and CSS module responses with missing, invalid or
incompatible MIME types before parsing their source. Share the validation
with Worker JSON imports and stored Worker module resource checks.

Extract the response MIME essence using Fetch's combined header-list rules,
including quoted commas, invalid entries and wildcard entries. Preserve the
existing separate transport MIME interpretation for other response users.

Cover real HTTP module loads and repeated/quoted Content-Type fields in
Window and Worker paths.
2026-09-23 09:06:17 +08:00
ldm0 a5b110626f fix(webidl): use native receiver brands for DOM bindings
Enable shared receiver checks for Document structure, CharacterData, Text, ProcessingInstruction and affected HTML element templates. Remove redundant EventTarget Proxy and HTMLElement checks so registered native Proxies remain valid receivers.

Resolve windowless CharacterData through native handles while preserving UTF-16 data, Text/CDATA wholeText, range updates and detached XPath invalidation. Cover invalid receivers, conversion ordering, cross-realm errors and native Proxy event dispatch.
2026-09-23 09:06:04 +08:00
ldm0 8c05f3e610 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-09-23 09:06:04 +08:00
ldm0 dc82fd6d19 fix(wpt): deduplicate stylesheet fixtures after main rebase
Keep the shared, namespaced stylesheet counter and its stronger cache-control regression test. Remove replayed definitions that Python would silently shadow. Validation: 364 WPT Python tests passed; AST checks found no duplicate definitions.
2026-09-23 09:06:04 +08:00
ldm0 33ae5859b4 fix(worker): select module source format from response MIME
Key worker module maps by the requested JavaScript-or-Wasm or JSON type,
then select the compiler from HTTP and data URL response MIME. Preserve
Wasm bytes, decode text modules as UTF-8, and accept text/json consistently.

Reject source imports of compiled JavaScript without poisoning evaluation
or holding the graph borrow during promise rejection. Record the actual
Service Worker resource kind and cover suffixes, encodings, import
attributes, root reuse, and concurrent cache access.
2026-09-23 09:06:04 +08:00
ldm0 6ea429ec19 fix(worker): separate source imports from graph evaluation
Traverse only evaluation dependencies reachable from each loading job. Resolve source imports once their root is compiled, and resume joined evaluation imports through linking instead of reading an uninstantiated namespace.

Cover skipped dependency fetches, cached source reuse, concurrent phases, failure isolation, and shared root fetch failures.
2026-09-23 09:05:46 +08:00
ldm0 2e8c622ff4 fix(script): require supplied JavaScript MIME for strict loads 2026-09-23 09:05:46 +08:00
ldm0 e3becded7c fix(wpt): serve service worker registration error fixtures 2026-09-23 09:05:46 +08:00
ldm0 97225b4539 fix(service-worker): implement registration update jobs 2026-09-23 09:05:46 +08:00
ldm0 5bb2f52ee1 fix(wpt): serve service worker update lifecycle fixtures 2026-09-23 09:05:46 +08:00
ldm0 40d21eb171 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-09-23 09:05:46 +08:00
ldm0 abeba4a168 fix(wpt): serve service worker imported script assignments 2026-09-23 09:05:46 +08:00
ldm0 fc443778d4 fix(wpt): serve service worker import and update fixtures
Implement redirect.py, update-worker.py and import-scripts-version.py with
upstream response metadata and shared per-resource update counters. Select
only references that resolve to these supported handlers.

Validate against 41 requests to the original upstream handlers, 627 Python
tests and 7 WPT files with unchanged browser binaries.
2026-09-23 09:05:46 +08:00
ldm0 457d3254ff 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-09-23 09:05:46 +08:00
ldm0 bb4ec4a971 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-09-23 09:05:46 +08:00
ldm0 5c65449d65 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-09-23 09:05:46 +08:00
ldm0 58a58d6c89 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-09-23 09:05:46 +08:00
ldm0 580e5f1181 fix(csp): block fetch redirects before network access 2026-09-23 09:05:29 +08:00