Commit Graph
1385 Commits
Author SHA1 Message Date
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
ldm0 94c7b64f43 fix(location): navigate after rejected protocol replacements
Keep syntax failure separate from a non-failing scheme-state termination.
After a valid replacement is rejected, navigate the preserved HTTP(S) URL
instead of returning early on Url::set_scheme's error.

Handle permitted file transitions without credentials or a port as
non-HTTP(S) results; url 2.5.8 otherwise rejects these more broadly than
the URL algorithm. Preserve navigation for file transitions blocked by
credentials or a non-default port.

Replace the old no-navigation expectation with per-case navigation
assertions and iframe reloads that require a new Document. Cover empty
credentials, normalized default ports, and non-HTTP(S) result boundaries.
The new unit regression and iframe fixture fail on the previous PR head;
all five focused tests and all four Chromium fixture subtests now pass.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets
--all-features -- -D warnings; cargo nextest run --no-fail-fast
(18,925 passed, 16 skipped). Chromium 145.0.7632.116 fixture: 4/4 pass.
2026-09-30 16:46:06 +08:00
ldm0 ced40f9906 fix(location): apply protocol setter scheme rules
Parse Location.protocol with scheme-state override rules: normalize ASCII tabs/newlines, stop at the first colon, reject invalid syntax with a DOMException and ignore incompatible or non-HTTP(S) results. Preserve navigation for an unchanged valid protocol. Tests cover invalid values, no-op schemes and queued same/changed-scheme navigations, plus a ported WPT fixture.

Validation: all branch checks passed. Summary [ 180.787s] 18923 tests run: 18923 passed (5 slow), 16 skipped
2026-09-30 16:46:06 +08:00
ldm0 6c572b385d fix(preload): preserve modulepreload scanner order 2026-09-30 16:40:48 +08:00
ldm0 4c56f704a3 perf(dom): update registry associations without global scans 2026-09-30 12:38:04 +08:00
ldm0 c1fc9cad91 fix(indexeddb): expose native version change event attributes 2026-09-30 12:36:13 +08:00
ldm0 7d753485f6 fix(document): reset child quirks mode when opening a stream 2026-09-30 12:34:17 +08:00
ldm0 07231c6baa fix(document): reject XML child document stream operations 2026-09-30 12:31:00 +08:00
ldm0 789d6a9b23 fix(storage): reuse Window accessors for popup Storage 2026-09-30 12:04:21 +08:00
ldm0 368eabd081 refactor(dom): share associated Window lookup for documents 2026-09-30 12:03:13 +08:00
ldm0 fde957b853 fix(dom): preserve native element interfaces in XML documents 2026-09-30 12:02:32 +08:00
ldm0 1e2b0bb46e fix(dom): enforce document.domain registrable boundaries 2026-09-30 12:01:16 +08:00
ldm0 0f7fddbeb2 fix(dom): retain inherited base URLs across history updates 2026-09-30 10:53:38 +08:00
ldm0 53121ae26b fix(dom): expose native NodeList snapshots in mutation records 2026-09-30 10:45:20 +08:00
ldm0 daf6edd4e3 fix(dom): preserve fragment insertion mutation boundaries 2026-09-30 10:37:18 +08:00
ldm0 c59d8af049 fix(xhr): validate and combine author request headers 2026-09-30 10:32:11 +08:00
ldm0 fbe5a80418 fix(script): share the service-worker loader for child classics 2026-09-30 10:28:34 +08:00
ldm0 c1f40cebca refactor(cssom): share native inline styles for windowless elements 2026-09-30 10:25:37 +08:00
ldm0 f7d21c8c71 fix(observers): preserve intersection target observation order 2026-09-30 10:23:09 +08:00
ldm0 0e553d5a5f fix(webidl): check required arity before argument conversion 2026-09-30 10:21:52 +08:00
ldm0 c600a688e9 fix(indexeddb): convert iterable key paths only once 2026-09-30 10:20:43 +08:00
ldm0 7993cd48a1 fix(cssom): remove all from detached and rule declarations 2026-09-30 10:19:39 +08:00
ldm0 d92d4da858 test(wpt): refresh cases after MIME fixes
Run the full 13,631-case profile on source 112a97e61 with Moli and Chromium
145.0.7632.116 at parallelism 50, using WPT db95fafd1fcef8428805e41eb5705d444e8c67ce.
The case set and fixed scheduling order match the previous full run.

Moli: 9,540 pass, 3,704 fail, 263 timeout, 61 error, 10 crash, 53 harness-stalled.
Chromium: 11,388 pass, 1,897 fail, 242 timeout, 16 error, 18 crash, 70 harness-stalled.
All three JSON module regressions pass on both engines. Relative to 7d9a0a98c,
11 cases gain pass and five lose pass, for a net increase of six.

Keep raw full-run outcomes. Four pass losses pass once on both frozen binaries
in focused diagnostics; SharedWorker-extendedLifetime fails identically in
all three focused runs on each binary, including the pre-fix build.

Validate complete per-engine execution, exact raw/matrix agreement, and sorted,
disjoint, exhaustive status lists. No missing cases or recovery placeholders.
2026-09-29 23:17:46 +08:00
ldm0 ce2edbb9e1 fix(mime): unify JSON/font types and response header extraction
Accept text/json for JSON modules and use one is_json_mime classifier across
modules, documents, JSONPath, and resource inspection. Remove the module and
document aliases and recognize the seven registered application font types.

Use Fetch MIME extraction over the complete Content-Type header list for
script/style checks, workers, WebAssembly, ORB, and JSONPath. Derive classic
script charsets from the same MIME record, including charset inheritance and
resets when the MIME essence changes, while preserving BOM and fallback order.

Cover valid and invalid MIME types, header ordering, combined fields, quoted
commas, nosniff, and charset selection with regression tests.

Validation:
- cargo fmt --all
- cargo clippy --workspace --all-targets --all-features -- -D warnings
- cargo nextest run --no-fail-fast: 19,005 passed, 16 skipped
- Focused WPT: Moli passes 9 cases / 261 subtests, including the three JSON
  regressions and all 31 script Content-Type extraction checks.
2026-09-29 23:17:46 +08:00
ldm0 9d78cb34af test(wpt): refresh full cases on current head
Run the unfiltered all profile against WPT db95fafd1f with Moli built
from 7f9b8b63d (dev, debug=0) and Chromium 145.0.7632.116, using 50 CDP
workers. Both engines execute all 13,631 cases without setup errors,
missing results, or unexecuted recovery placeholders.

Moli: 9,534 pass, 3,708 fail, 264 timeout, 63 error, 52 harness-stalled,
and 10 crash. Chromium: 11,383 pass, 1,899 fail, 242 timeout, 17 error,
72 harness-stalled, and 18 crash.

Compared with the previous lists, 171 cases gain pass and 11 lose pass,
for a net gain of 160. Of the previous refresh's 104 pass losses, 101
now pass, two fail, and one errors. Retain the original full-run
outcomes; separate diagnostic reruns do not replace list statuses.

Validate all eight lists against the raw results and matrix: sorted,
disjoint, exhaustive, and complete. git diff --check passes.
2026-09-29 23:17:46 +08:00
ldm0 7f9b8b63d7 test(wpt): refresh full cases after navigation preload fix
Run unfiltered profile all on WPT db95fafd1fcef8428805e41eb5705d444e8c67ce
with Moli built from 8ba39c4aa1 and Chromium 145.0.7632.116, 50 workers.
Both engines produced results for all 13,631 cases.

Moli: 9,374 pass, 3,686 fail, 260 timeout, 247 error, 54 harness-stalled,
10 crash. Chromium: 11,334 pass, 1,888 fail, 272 timeout, 30 error,
89 harness-stalled, 18 crash.

Complete 91 previously unexecuted cases after a worker exhausted its
restart budget, using the same binary and fixture in bounded batches.
Use their first measured outcomes (63 pass, 26 fail, 2 timeout); preserve
all actual full-run failures and crashes. Both samesite-iframe and
empty-preload-response-body now pass in both engines.

Validate all eight status lists against the raw results and matrix:
sorted, disjoint, exhaustive, with no missing or unexecuted cases.
Compared with the previous refresh, 65 cases gain pass and 104 lose pass
(98 probe errors, 6 failures). Before/after diagnostic rechecks recover
31 of those 104 on the fixed binary; the other 73 also fail or error on
the old binary. Diagnostic retries do not replace full-run outcomes.
2026-09-29 19:03:23 +08:00
ldm0 f6ef80e399 fix(service-worker): allow navigation preload during activation
Recognize the activating version while the runtime keeps it in the waiting
slot until activate settles. NavigationPreloadManager can now enable,
disable, read state and set its header during initial activation, and the
state is persisted when activation completes.

Cover the inactive/activating boundary and persistence in a runtime test,
plus a real iframe navigation served through event.preloadResponse.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets
--all-features -- -D warnings; cargo nextest run --no-fail-fast
(18,933 passed, 16 skipped). The four selected navigation-preload WPT cases
improve from 1 pass / 1 fail / 2 timeout to 3 pass / 1 fail; both the same-site
iframe and empty preload body cases now pass.
2026-09-29 19:03:23 +08:00
ldm0 ac9b83d21e chore(wpt): refresh full cases with consolidated fixtures
Run the unfiltered all profile on Moli c429911cdf and Chromium
145.0.7632.116 using WPT db95fafd1f and 50 CDP workers. Moli was
built from this branch with cargo build --locked (dev, debug=0).

Both engines completed all 13,631 cases without setup errors or
recovery-aborted cases. Keep the existing 13,558 cases and add 73.
Moli: 9,413 pass, 3,687 fail, 264 timeout, 202 error, 55
harness-stalled, and 10 crash. Chromium: 11,380 pass, 1,899 fail,
243 timeout, 19 error, 72 harness-stalled, and 18 crash.

Verify all eight lists are sorted, disjoint, complete and exactly
match the Moli matrix. Preserve the raw statuses, including 200
five-second CDP evaluate probe timeouts. The previous snapshot
used Moli d40181f729; this refresh is not a controlled fixture A/B.
2026-09-29 19:03:23 +08:00
ldm0 5e80001318 refactor(wpt): unify fixture dispatch and preserve raw response headers
Reconcile the shared HTTP handlers and discovery rules from the split PRs with the complete fixture surface in wpt-misc-fix. Share stash namespaces and XHR dispatch, retain the existing testdriver bridge, preserve raw header values, and carry forward the remaining pipe, template, and dynamic-import regressions.

Validation: 742 Python tests across 74 modules pass; focused Ruff checks and git diff --check pass. With fixed Moli and Chromium binaries, a 27-case WPT comparison against main improves whole-case passes from 7 to 26 and 6 to 23 respectively, with no previously passing case regressing.
2026-09-29 19:03:23 +08:00
ldm0 4473d42935 fix(wpt): serve MIME-controlled nosniff scripts
Carry the remaining HTTP fixture and its regression tests from wpt-misc-fix at 3cd3c8968b.
2026-09-29 19:03:23 +08:00
ldm0 a9dc675b0a fix(wpt): serve form echo bodies as hexadecimal bytes
Carry the remaining HTTP fixture and its regression tests from wpt-misc-fix at 3cd3c8968b.
2026-09-29 19:03:23 +08:00
ldm0 446ac04b9b fix(wpt): serve worker URL encoding fixtures
Carry the remaining HTTP fixture and its regression tests from wpt-misc-fix at 3cd3c8968b.
2026-09-29 19:03:23 +08:00