Commit Graph
1416 Commits
Author SHA1 Message Date
ldm0 9bc97b0cc4 feat(media): expose MediaSource handle and buffer interface shells 2026-10-01 23:11:42 +08:00
ldm0 4c264b2d92 fix(indexeddb): preserve factory conversion and request ownership
IDBFactory.cmp preserves exceptions from key getters and reports invalid keys as DataError instead of rewriting both cases to TypeError. The generated receiver check continues to run before key conversion.

Schedule open/delete operations in the factory receiver’s realm after completing argument conversions in the callee realm. Borrowing an iframe method previously created a correctly branded request but scheduled its upgrade in the wrong context, leaving it pending.

Expand the factory regression fixture to exercise key conversion and request completion after removing the genuine factory prototype, using main Window, child Window and worker factories. Correct the ported cmp(undefined, key) expectation to DataError.
2026-10-01 18:24:57 +08:00
ldm0 3b35e5fa0f fix(fetch): separate manual hop lookup from transport redirect limits
Keep redirect URL lookup available when the renderer follows HTTP hops itself. A transport request with follow_redirects=false must not reapply the automatic transport redirect limit to the renderer’s already-recorded URL chain; automatically followed requests retain their existing limit. CORS checks still run for every browser-managed hop.

The regression verifies manual lookup at the transport limit, rejection for automatic following at the same limit, and rejection when the manual hop lacks CORS permission.
2026-10-01 16:57:00 +08:00
ldm0 e6e9a3309c feat(webidl): add lossless DOMString conversion
Add an explicit UTF-16 DOMString converter for bindings that must preserve lone surrogates. Reuse the existing UTF-16 extraction helper and keep this change additive, without rerouting the existing DOMString converter.

Regressions cover code-unit preservation, scalar conversion, null-to-empty options, single string-hint coercion, exception identity and callee-realm TypeErrors. Existing DOMString and USVString behavior is also checked.
2026-10-01 16:54:03 +08:00
ldm0 e03f6a71c5 feat(webidl): support restricted float conversion
Add the WebIDL restricted float converter and f32 inference in generated argument and dictionary bindings. Round finite numbers to binary32, reject values that become nonfinite, and preserve exceptions from numeric conversion.

Regression coverage compares rounding with V8 Math.fround, including signed zero, subnormals and overflow, and checks implicit/explicit derived argument conversion, single coercion, exception identity and the callee TypeError realm. Extracted from the AudioBuffer commit without an audio runtime dependency.
2026-10-01 16:53:47 +08:00
ldm0 5c19ed1006 refactor(dom): resolve attribute references in the renderer handler 2026-10-01 16:51:46 +08:00
ldm0 eb2d679e44 refactor(automation): name semantic commands and renderer CDP calls 2026-10-01 16:51:46 +08:00
ldm0 f2cd0fd488 refactor(cdp): pass preload commands directly between phases 2026-10-01 16:51:46 +08:00
ldm0 28e40e5287 refactor(renderer): publish nested prefixes with their retention fences 2026-10-01 16:51:46 +08:00
ldm0 64033a0be9 refactor(renderer): retain the native terminal fence without its covered prefix 2026-10-01 16:51:46 +08:00
ldm0 4a5e28d119 refactor(test): share CDP completion with renderer events 2026-10-01 16:51:46 +08:00
ldm0 cb28d957e1 refactor(cdp): share CSS inventory notification payloads 2026-10-01 16:51:46 +08:00
ldm0 30b7d61eb4 refactor(cdp): project native terminals with other renderer records 2026-10-01 16:51:46 +08:00
ldm0 429847e98a refactor(renderer): use one document serialization command 2026-10-01 16:51:46 +08:00
ldm0 0b892ccb59 refactor(cdp): reuse Emulation admission and transient failures 2026-10-01 16:51:46 +08:00
ldm0 e36271e0d0 refactor(cdp): let preparation select supported native commands 2026-10-01 16:51:46 +08:00
ldm0 7cef1b4e51 refactor(cdp): remove single-variant DOM and AX work wrappers 2026-10-01 16:51:46 +08:00
ldm0 117dce412b refactor(cdp): share node lookups with explicit chain execution 2026-10-01 16:51:46 +08:00
ldm0 6e30806c72 refactor(cdp): register remote objects from the terminal payload 2026-10-01 16:51:46 +08:00
ldm0 0c3b9cd6d3 refactor(cdp): format native replies without adapter output plans 2026-10-01 16:51:46 +08:00
ldm0 88639900ac test(fetch): wait for child document decoding message
Wait for the child document decoding result to arrive through its queued message task before reading the serialized parent document. Preserve the existing Shift_JIS content assertion and use the browser's bounded event-driven wait to remove the race between fetch completion and message delivery.
2026-10-01 05:41:44 +08:00
ldm0 d3f4d43d98 fix(window): expose native closed accessors 2026-10-01 05:40:16 +08:00
ldm0 565c84adbf fix(messaging): preserve MessagePort endpoints across document lifecycle 2026-10-01 05:38:51 +08:00
ldm0 a2dc94d6b2 fix(window): expose status through native string accessors 2026-10-01 04:01:07 +08:00
ldm0 03c8e143e6 refactor(renderer): return anyhow errors from bridge identity lookups 2026-10-01 04:00:26 +08:00
ldm0 caaf1f4e5a fix(dom): preserve trailing dots in document.domain
Preserve the trailing dot returned by the URL host parser when reading or assigning document.domain. Removing that dot incorrectly treats dotted and undotted hosts as the same origin-domain.

Keep the existing public-suffix and registrable-domain checks. Regressions cover literal, repeated, percent-encoded and IDNA dots, parent-domain relaxation, main documents, inherited or independently navigated frames, and navigated popups.
2026-10-01 03:53:50 +08:00
ldm0 7f98be640a fix(dom): validate Document insertion before mutation
Validate Document appendChild and insertBefore before removal or adoption. Existing roots and doctypes remain in the validation sequence, including the detached bridge, so an invalid insertion fails without changing the tree.

Regressions cover main, iframe, windowless and parsed documents, root reinsertion, invalid fragments, allowed comments and processing instructions, and unchanged ranges, observer records and custom-element reactions. Initialize legacy fixtures with a valid HTML shell while preserving their feature assertions.

The validation order follows the DOM pre-insert algorithm: https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
2026-10-01 03:52:41 +08:00
ldm0 edd0057eed fix(webidl): validate observer receivers and isolate native state
Author properties can currently overwrite MutationObserver and IntersectionObserver identifiers or options, and invalid receivers can reach observer callbacks. Use the existing native receiver checks and V8 private slots for observer identity and configuration.

Freeze IntersectionObserver thresholds, return fresh chronological PerformanceObserverEntryList sequences, and correct observer method lengths. Regressions cover cross-realm genuine and forged receivers, conversion order, queue isolation, frozen thresholds, and independent result arrays. Update the local ported PerformanceObserver IDL fixture to its optional dictionary signature.

Keep duplicate IntersectionObserver thresholds after sorting, as required by the initialization algorithm: https://www.w3.org/TR/intersection-observer/#initialize-new-intersection-observer
2026-10-01 03:50:27 +08:00
ldm0 b3ef2ec3e3 fix(webidl): validate Event receivers with native brands
An invalid receiver can reach Event callbacks, including a native initEvent path that can abort the process. Enable the existing WebIDL receiver checks on Event and the event interfaces already present on main, before callbacks and argument conversion.

Genuine events and inherited event interfaces remain usable across realms. The regression matrix rejects forged objects, author and revoked Proxies without evaluating conversion hooks or Proxy traps, and checks TypeError in the callee realm. Existing spoofing tests retain their real-object assertions and now require TypeError for invalid receivers.
2026-10-01 03:49:21 +08:00
ldm0 75b191092d fix(cdp): keep DOM agent commands available while paused 2026-10-01 03:33:13 +08:00
ldm0 13877aa2bf test(cdp): lock renderer reply ordering in smoke 2026-10-01 03:33:13 +08:00
ldm0 f62894ec3c refactor(cdp): publish Emulation replies with exact replay ownership
Use the shared frontend admission and native terminal path for renderer
configuration. Keep Browser replay policy on its captured owner, record
admitted idle state, and project a fallback only if publication lost.

Verify mixed native replies precede later Inspector replay and that
isolate-entering configuration waits for the suspended owner to resume.
2026-10-01 03:33:13 +08:00
ldm0 69b3f96239 refactor(cdp): publish DOM and debugger replies with ordered state updates
Migrate node queries, edits, focus, files, remote objects, DOMDebugger and
Autofill to renderer-owned terminals. Freeze document notifications and
object registry updates at the producer boundary, preserve object aliases,
and keep isolate-entering lookup chains on the owner turn.
2026-10-01 03:33:13 +08:00
ldm0 44011a899c refactor(cdp): publish CSS and accessibility replies at the renderer
Run native lookups and bounded continuations through the shared terminal
path. Publish stylesheet inventory notifications before ready responses,
and preserve exact owner routing in direct Page test fixtures.

Use the parsed fixture and stylesheet notification boundary to verify
Page and CSS commands preserve their independent isolate-entry requirements.
2026-10-01 03:33:13 +08:00
ldm0 a18314640a refactor(cdp): publish native terminals through the renderer journal
Share terminal authority with Inspector and publish ready native replies
after their renderer facts, independently of adapter polling. Keep typed
internal completions separate and settle caches against the exact residence.

Define exhaustive backend entry requirements for nested Main dispatch and
release Main and IO admission at backend entry. Bind native continuations
and preserve their owner lifecycle before terminal projection.

Migrate Page and DOMSnapshot through the generic operation boundary,
including live tree URLs, initial DocumentLoader identity, document capture
and isolated worlds. Cover cancellation, retirement and pause ordering,
and release held popup fixture routes before awaiting initialization.
2026-10-01 03:33:13 +08:00
ldm0 89863e976c fix(cdp): replay Runtime notifications before enable responses
Publish existing contexts, console messages and exceptions before the
Runtime.enable terminal for pages and workers. Check the enable boundary
without a compensating command, and retain deferred reply progress.
2026-10-01 03:33:13 +08:00
ldm0 f98088d297 fix(history): resolve queued joint steps independently of realm anchors
A joint traversal stores the initiating realm current entry only as an admission anchor. Resolve the stable joint step against the owning Window instead of rejecting an isolated-realm anchor against the default realm entry list. Preserve entry validation for traversals without a joint step.
2026-10-01 03:33:13 +08:00
ldm0 eb37fce1a3 chore(release): update version to 1.1.12 v1.1.12 2026-09-30 23:46:27 +08:00
ldm0 8fbf13300c fix(svg): reject trailing decimal path numbers 2026-09-30 22:57:34 +08:00
ldm0 4e2f6caa46 feat(worklet): expose native interfaces and independent module promises
Expose Worklet and AudioWorklet with shared branded prototypes and the readonly BaseAudioContext.audioWorklet attribute. Native factories bypass replaceable public constructors; each addModule call gets its own promise and rejection state.

Tests cover WebIDL conversion order, forged/proxy receivers, intrinsic factories, cross-realm results and independent module completion promises, including the existing Worker-backed module loader.

AudioWorklet execution still uses the existing per-module Worker backend. A shared AudioWorkletGlobalScope, real DSP/message ports, Blob dependency loading and complete parser/AbortError handling remain follow-up.

Tests cover top-level Window and same-origin iframe realms, plus applicable Worker globals. Popup exposure remains with the separate popup-realm migration on the integration branch; main still uses a legacy Window shell without a complete realm.

Rebased onto main, with separate exposure-list and Worker regression insertion points from WebGL, Cache and ServiceWorker.

An initial full test run hit the existing synchronous-XHR watchdog wall-clock assertion at 4.208s (limit 4s). The unchanged-tree focused recheck and subsequent full run passed, with no automatic retries; the initial log is preserved.
2026-09-30 22:54:44 +08:00
ldm0 a2a71161b4 feat(events): expose native device motion and orientation payloads
Expose DeviceMotionEvent and DeviceOrientationEvent in secure Window realms with native acceleration/rotation-rate payloads, WebIDL dictionary conversions and receiver branding. Create events through intrinsic constructors and check secure exposure using native realm metadata, preserving the callee realm for operation exceptions.

Tests cover nullable numeric payloads, conversion order, hostile receivers, inheritance, cross-realm calls, secure/insecure exposure and legacy createEvent. The extraction retains main's existing BeforeUnloadEvent-to-Event fallback; migrating beforeunload payload semantics is separate.

Real sensor readings and permission requests remain unimplemented.

Tests cover top-level Window and same-origin iframe realms, plus applicable Worker globals. Popup exposure remains with the separate popup-realm migration on the integration branch; main still uses a legacy Window shell without a complete realm.

Device event imports and constructor dispatch entries use separate insertion positions from WebGLContextEvent; this PR remains independent against main.
2026-09-30 22:51:54 +08:00
ldm0 7a93a3b614 feat(webgl): expose resource and value interfaces
Expose the missing WebGL resource and value interfaces through the intrinsic registry in Window and Worker realms. Preserve WebGLObject inheritance for opaque resources and reject direct construction.

WebGLContextEvent uses native Event state with EventInit/statusMessage conversion and receiver checks; WebGLShaderPrecisionFormat stores existing precision-query results in native private fields behind shared readonly getters. Regression fixtures cover constructor/prototype descriptors, UTF-16 event payloads, dispatch, cross-realm receiver validation and Worker exposure.

Opaque GPU resources and WebGLActiveInfo remain interface shims; this change does not implement a GPU backend or shader reflection.

The extracted tests cover top-level Window and same-origin iframe realms. The legacy popup shell on main has no complete ECMAScript/Web API global surface; popup coverage stays with the separate popup-realm migration on the integration branch. The initial full-suite failure was confined to popup checks; it is retained in extraction logs.

Rebased onto current main. Worker regression placement is beside the existing WebGL tests, so unrelated API tests no longer all append at the end of postmessage.rs.
2026-09-30 22:50:55 +08:00
ldm0 ac1b284fe3 feat(cache): expose native interfaces in secure realms
Expose Cache and CacheStorage in secure Window/Worker globals and attach existing cache backend objects to shared intrinsic prototypes. Keep illegal constructors, receiver validation and prototype descriptors in native bindings.

Coverage checks returned object prototypes, methods and invalid receivers, fresh results and insecure-context exclusion. Existing cache operations continue to use their current storage backend.

This is interface exposure, not a new cache storage engine: add/addAll and complete Vary semantics remain follow-up.

Tests cover top-level Window and same-origin iframe realms, plus applicable Worker globals. Popup exposure remains with the separate popup-realm migration on the integration branch; main still uses a legacy Window shell without a complete realm.

Rebased onto current main. Cache exposure entries are inserted at their own positions in the Worker and secure-context lists, separated from the ServiceWorker additions.
2026-09-30 22:50:21 +08:00
ldm0 4cd59fc906 perf(modules): share immutable binary sources across compilation
Use Arc<[u8]> for Binary sources in the portable module tree and renderer.
Cloning fetched sources and module-map entries now shares the original bytes
instead of copying the entire Wasm file. Compilers still borrow &[u8].

Preserve the existing policy that retains Wasm raw bytes in the module map
after compilation. Keep this change separate from synthetic text ownership.

Exercise both evaluation and source import phases through the actual module
tree compile path. Verify identical byte addresses, one remaining strong
owner after fetch temporaries are dropped, and release on document disposal.
The new regression fails with the previous Vec<u8> representation.

Validation:
- cargo fmt --all
- cargo clippy --workspace --all-targets --all-features -- -D warnings
- cargo nextest run --no-fail-fast: 19,014 passed, 16 skipped
2026-09-30 19:04:39 +08:00
ldm0 bfa903ab43 fix(modules): share synthetic source text and release map references
JSON/CSS compilation retained independent copies in the module map and the
synthetic module record. Share immutable text with Arc<str> across fetched
sources, the portable module tree, and synthetic evaluation records instead
of copying String buffers during cloning and registration.

Release the module-map source after successful JavaScript/JSON/CSS compilation.
Make fetched-source retention an exhaustive ModuleKind policy, preserving Wasm
and text-preload source semantics. Context lookups remain weak record references.

Cover the actual module-tree compile path: the record keeps exactly one strong
reference to the original text allocation after fetch temporaries are dropped,
and destroys it when disposed. Verify record clones share the same source and
Wasm entries retain their binary source.

Validation:
- cargo fmt --all
- cargo clippy --workspace --all-targets --all-features -- -D warnings
- cargo nextest run --no-fail-fast: 19,013 passed, 16 skipped
2026-09-30 19:04:39 +08:00
ldm0 fdd0542c53 fix(modules): bind synthetic sources to their compiled records 2026-09-30 19:04:39 +08:00
ldm0 ab6e81f399 feat(media): expose native device info interfaces
Expose MediaDeviceInfo and InputDeviceInfo through the secure Window intrinsic registry, with the required inheritance, illegal constructors, readonly attributes and shared prototype methods. Generated receiver validation rejects forged and author Proxy receivers before running author hooks.

Serialize private native fields into a fresh callee-realm object with data properties, preserving UTF-16 and ignoring shadowed public getters or inherited setters. Tests cover main/iframe/popup interfaces, insecure contexts, Worker exclusion and native field serialization.

This is an interface shim over the current media backend: enumerateDevices() still returns an empty list, and getCapabilities() returns a fresh empty dictionary. Device discovery, permission state and real capture capabilities remain unimplemented.
2026-09-30 18:45:36 +08:00
ldm0 2b5657d6e6 perf(dom): bound indexed queries by the subtree size 2026-09-30 17:32:09 +08:00
ldm0 4bb110f56c fix(selection): synchronize endpoints after live Range mutations 2026-09-30 16:56:38 +08:00
ldm0 7ffef8b636 fix(navigation): classify same-document requests by URL fragments 2026-09-30 16:47:14 +08:00