Commit Graph
1582 Commits
Author SHA1 Message Date
ldm0 0f272ee00a fix(indexeddb): schedule transactions across scopes and agents
Coordinate regular transactions across connections and event loops using
native admission leases. Include pending predecessors in scope conflicts,
wake the accepting realm after commit or abort, and retire admissions when
connections or workers close. Deferred starts retain native mode and scope.

Readonly transactions no longer publish snapshots. Merge ordinary writes
only within their store scope and check quota against the merged database
so disjoint commits cannot overwrite each other or bypass quota.

Cover FIFO admission, persistent stores, quota and teardown in native tests,
and exercise transaction ordering and worker termination in Window, child
Window and Worker integration tests.
2026-09-23 09:16:32 +08:00
ldm0 abbb218f15 fix(indexeddb): snapshot queued queries and support range deletion
Keep converted key ranges, counts and directions in the transaction queue.
Query execution no longer reads caller-owned arrays, dates or binary buffers
again. Use one owned operation enum instead of separate Local/Global forms.

Apply the same range conversion to delete(), including synchronous read-only
validation, single conversion of key getters, and open/closed range bounds.
Keep point deletion on its direct key lookup path.

Cover blocked and started transactions, mutations and detached buffers,
getter evaluation, store/index results, preceding writes, range deletion
and rollback in Window, child and worker realms with a Chromium control.

Validation: cargo fmt --all; strict full workspace Clippy; 19,174 nextest
tests passed. The 220-case WPT matrix improves from 190 to 196 passing cases,
with 14 newly passing subtests and no regression. The 548-check fixture passes
unchanged in Moli and Chromium Window/Worker, plus Moli child-realm coverage.
2026-09-23 09:16:12 +08:00
ldm0 b3d115c828 fix(indexeddb): preserve key types and conversion errors
Represent Number, Date, UTF-16 string, binary and compound keys separately
with IndexedDB ordering. Preserve binary snapshots and signed zero values,
reject invalid keys without coercion, and retain exceptions from key getters
through ranges, queries, writes and cursor operations.

Persist compound keys as flat tokens so deep keys survive database reopen,
while continuing to read legacy key records. Correct the key generator's
inclusive 2^53 limit and distinguish missing arguments from undefined keys.

Validation: cargo fmt --all; full workspace Clippy with all targets/features
and -D warnings; cargo nextest run --no-fail-fast. The 180-case IndexedDB WPT
comparison gains 24 passing cases and 188 passing subtests with no regression.
The same 259-check fixture passes in Chromium and Moli Window/Worker, with
Moli integration coverage for child realms and native disk reopen tests.
2026-09-23 09:15:49 +08:00
ldm0 4ff65b61e4 fix(indexeddb): snapshot writes before evaluating keys 2026-09-23 09:15:25 +08:00
ldm0 a73495e840 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-09-23 09:15:00 +08:00
ldm0 78ef43355c fix(indexeddb): abort invalid unique index builds in request order
Validate stored keys when creating a unique index and queue its failure as
an owned transaction operation. Preserve earlier request successes, abort
pending requests, and roll back upgrade metadata and data without throwing
from createIndex. Later mutations cannot erase the captured failure.

Deduplicate multiEntry keys within each record in shared key extraction so
index creation, writes, queries and cursors agree on uniqueness.

Cover Window, iframe and Worker execution, persisted upgrades, explicit
commit/abort, rollback, request event ordering and multiEntry duplicates.
The 102-case official WPT sample improves from 88 to 92 passes without
regressions; createIndex also gains two passing subtests per environment.
2026-09-23 09:14:38 +08:00
ldm0 da8342cc0f 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-09-23 09:14:37 +08:00
ldm0 3d410674d3 fix(indexeddb): preserve native request state and factory event metadata
Expose request attributes through branded readonly getters, including pending
result/error exceptions and cross-realm error and value identity. Keep native
state independent of author properties across cursor reuse and upgrade results.

Set done before upgradeneeded, reset aborted opens after transaction abort,
and deliver close-after-commit errors without another pending transition.
Capture deleted database versions before releasing the manager lock and emit
trusted intrinsic events with the required flags and version metadata.

Validate Window, iframe and worker behavior, property and constructor overrides,
cursor reuse, abort and close boundaries, and cross-realm getters. Record 12
new complete WPT passes; all 32 prior passes in the 50-case set remain passing.
2026-09-23 09:13:54 +08:00
ldm0 40de175cb0 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-09-23 09:13:42 +08:00
ldm0 c83d07fa16 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-09-23 09:13:27 +08:00
ldm0 8202ef21b5 test(wpt): record IndexedDB connection queue passes 2026-09-23 09:13:04 +08:00
ldm0 a6b37d7663 fix(indexeddb): serialize open and delete connection requests
Reserve every accepted request's position in a shared storage-key/name queue
before looking up the database version. Keep upgrades at the head until their
transaction and final connection-close check finish, and notify connections
created by earlier requests when each successor reaches the head.

Wake the accepting Window or worker event loop on completion, and release
retired owners only after closing their connections. Preserve per-connection
versionchange tasks and decide blocked events after their microtask
checkpoints, before a timer can close the notified connection.

Cover same/default versions, repeated open/delete, abort and VersionError,
completion-microtask close, cross-realm retirement, and bidirectional waiting
between a Window and a worker.
2026-09-23 09:13:04 +08:00
ldm0 72f916f689 test(wpt): record IndexedDB transaction lifetime passes 2026-09-23 09:13:04 +08:00
ldm0 6d949a3baa fix(indexeddb): queue versionchange notifications before blocked events
Give each connection its own task and microtask checkpoint, then recheck
blocking connections from the requesting realm. Retired notification realms
leave the recheck runnable, and connections closed by earlier callbacks are
skipped. Keep later same-database requests behind pending notifications.

Validation: cargo fmt --all; strict all-workspace Clippy; all 19,137 nextest
tests passed. Both official transaction-lifetime WPT variants now pass;
46-case comparison has no regressions.
2026-09-23 09:13:04 +08:00
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