Commit Graph
51 Commits
Author SHA1 Message Date
ldm0 454052c5a9 fix(dialog): dismiss modals in opening order per document 2026-11-13 01:42:40 +08:00
BibekPathak 00a464b355 fix(dialog): light-dismiss modal dialogs on Escape 2026-11-13 01:42:40 +08:00
ldm0 dc84a7ffab refactor(renderer): clarify script host and shared isolate names 2026-11-13 00:29:11 +08:00
ldm0 aa24f3aebc fix(modules): bind import.meta resolution to Window settings
Extracted from development commit 7f7d222c41.

Adapted to the target branch APIs. Validated with cargo fmt --all, full workspace Clippy (-D warnings), and cargo nextest run --no-fail-fast before committing.
2026-11-12 04:21:50 +08:00
ldm0 c886616705 fix(input): preserve access key document during dispatch 2026-11-12 01:24:21 +08:00
ldm0 76543af26c fix(input): scope access keys to their dispatch document 2026-11-12 01:24:21 +08:00
ldm0 79cdad5a9a fix(performance): retain DOM listener registration initiators 2026-11-07 03:30:13 +08:00
ldm0 1c26558eb7 fix(performance): retain Window callback registration initiators 2026-11-07 03:30:13 +08:00
ldm0 374ed832f7 fix(events): select Window onerror arguments and cancellation by native kind 2026-11-06 13:19:52 +08:00
ldm0 0b75b9e98d perf(renderer): defer realms for native lifecycle and inline events 2026-11-06 00:05:30 +08:00
ldm0 ac803a7639 fix(input): honor Document execution contexts before default actions 2026-11-05 21:15:30 +08:00
ldm0 0c4994e7e5 fix(renderer): preserve isolated Window worlds across frame lifetimes 2026-11-05 21:15:29 +08:00
ldm0 627e3165a5 fix(fetch): consume bodies on native receiver networking tasks 2026-11-04 15:08:29 +08:00
ldm0 de15d018dd fix(cookies): enforce native SameSite contexts for script and network access
Apply per-cookie SameSite restrictions to script reads while preserving HttpOnly and privileged CDP access. Carry relationship and navigation shape into canonical insertion checks before mutation, including overwrite and expiry deletion. Keep Secure SameSite=None, top-level response allowances and precise rejection reports; remove the blanket cross-site document-cookie denial.

Extracted from development commit 1b521cee146.
Base: wpt/20261030-cookie-age-aware-samesite (a170fb14b8).

Validation (32 build jobs and test threads): cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast.
     Summary [ 150.549s] 22175 tests run: 22175 passed (9 slow), 20 skipped
2026-11-02 11:12:00 +08:00
ldm0 5e6482996e feat(storage): open Cookie and localStorage databases on first use 2026-11-01 04:03:38 +08:00
ldm0 6fdc19ce13 fix(fonts): load used fonts during resource processing
Discover font demand from computed styles without triggering layout.
Honor the FONT policy, recheck fallback demand before readiness, and
invalidate child-document scans for ancestor style and viewport changes.

Share rendered control labels, marker counters and text normalization,
including generated items, inline boundaries, leaf boxes and suppressed
contents. Cover Unicode subsets, readiness and zero layout passes.
2026-10-28 05:55:19 +08:00
ldm0 fe75180032 refactor(events): make listener filtering modes explicit 2026-10-23 20:55:15 +08:00
ldm0 6212d06aa3 refactor(events): share native Worker dispatch and lifecycle cleanup 2026-10-23 20:55:15 +08:00
ldm0 e1876f39eb fix(events): release InputEvent live ranges after Node dispatch 2026-10-23 12:50:27 +08:00
ldm0 f681b6fb7c fix(renderer): project Node listeners and event targets into their world 2026-10-18 05:16:35 +08:00
ldm0 e1f2169f68 fix(renderer): project events across Realms of the same Window 2026-10-18 05:16:35 +08:00
ldm0 26ab1aa3c3 refactor(callbacks): remove legacy Window invocation layer 2026-10-15 14:35:34 +08:00
ldm0 e768ed37de fix(events): gate raw pointer update handlers on secure contexts 2026-10-09 19:06:50 +08:00
ldm0 111afae3bb feat(svg): expose native value and element interfaces
Completes native SVG value and element interface exposure in one independently mergeable PR against main, refreshing the former SVG constructor PR. Animated scalar values, angles, preserve-aspect-ratio values and live point/string/number/length/transform lists provide the shared native DOM foundation for the added elements.

Adds the remaining component-transfer, flood, image, merge, merge-node and tile filter interfaces; SVGSwitchElement and SVGMPathElement; and the animation, animate, set, animate-motion and animate-transform interfaces. Native factories, inheritance, SVGTests lists, attribute reflection, receiver validation and animation event handlers use native objects and the existing DOM backend.

Tests cover main/iframe realms, live and windowless documents, native identity, value/list mutation, units, Trusted Types, animation target resolution, handlers and timing argument validation. All internal SVG dependencies are included here, with no external PR merge order.

Filter raster rendering and SMIL scheduling remain unimplemented. Timing controls reject NotSupportedError, getStartTime reports no interval, and getCurrentTime remains zero. The separate SVG path parser changes and animated-string UTF-16 storage migration are excluded. The retained length synchronization is included; a separate ignored regression records the lone-surrogate limitation in the current DOM attribute storage.

SVG event-handler properties reuse main's existing shared event backend. Tests verify replacement, clearing, canonical event types, cancellation and realm/receiver identity; complete handler/listener registration-order semantics remain part of the separate event-handler backend migration.
2026-10-09 14:54:14 +08:00
ldm0 f32553ed04 fix: clarify renderer exports and preserve allocation-free error handoffs 2026-10-08 19:56:33 +08:00
ldm0 d3b6633c33 fix(renderer): release module owners on context teardown
Document teardown used the document.open reset, which preserves compiled
module records and pending dynamic imports. Their strong V8 handles rooted
retired Contexts and native Documents across shared-isolate navigations.

Release module records, pending imports, graph fetches and owner events on
context teardown. Preserve import-map metadata so externally retained module
functions can still access native DOM values and import.meta.resolve aliases.
Leave document.open module-map semantics unchanged.

Add regressions for compiled modules, pending dynamic imports, and exported
functions retained across teardown. All three collection regressions fail
before the fix; retained functions remain usable until their last V8 reference
is released.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets
--all-features -- -D warnings; cargo nextest run --no-fail-fast
(19,646 passed, 16 skipped). The initial run hit a 250ms CLI timeout
stage assertion; a full run with unchanged sources passed.

Release build with default Cargo parallelism. The CI real-site spider's
48-site peak RSS drops from 485.5 to 281.1 MiB, and last alive RSS drops
from 398.9 to 171.6 MiB. No forced GC was added to production navigation.
2026-10-06 22:54:34 +08:00
ldm0 c345a594f4 feat(webmcp): implement document tools and CDP integration
Expose secure Document.modelContext APIs with document-owned registrations,
callback realm and input validation, task-based result delivery, and independent
caller cancellation and target completion. Preserve cancellation reasons and
emit lifecycle events only for live owners.

Register native declarative forms in light and shadow trees through indexed
mutation candidates. Track schema changes to valid forms even before a
registration succeeds, including controls associated through a form attribute.
Use changed containers only for ancestor and form-owner checks; inspect added
and removed subtrees for discovery. Retire registrations at actual removal and
owner transitions while preserving submit handling and captured pending responses. Apply validated
fill intents to current options and checkable values in control event order.

Compute tools delegation from committed security origins, ancestor header
allowlists, container declarations, redirects, and combined sandbox policies.
Carry invocation identity, original origin, and resolved target through form
navigation; accept same-origin JSON-LD results and reject cross-origin commits.

Connect typed renderer observations to CDP discovery, invocation, cancellation,
and Runtime result projection. Include renderer and protocol regression coverage
for document lifetime, reentrancy, permissions, dynamic controls, and cancellation.

Validation on this commit tree: cargo fmt --all;
cargo clippy --workspace --all-targets --all-features -- -D warnings;
cargo nextest run --no-fail-fast.
Summary [ 100.619s] 19320 tests run: 19320 passed, 16 skipped
2026-10-05 15:25:06 +08:00
ldm0 dbdcbec7ba fix(timers): enforce stored deadlines
A one-millisecond timer could become runnable immediately after registration.
Remove the early dispatch allowance from the shared scheduler so registered
and rescheduled timers become runnable only at or after their actual
monotonic deadline. All readiness queries use the same rule.

Regression coverage checks registration-time and pre-deadline queries,
exact-deadline dispatch through filtered and unfiltered paths, and interval
rescheduling without advancing the new deadline.
2026-10-04 01:38:57 +08:00
ldm0 fdd0542c53 fix(modules): bind synthetic sources to their compiled records 2026-09-30 19:04:39 +08:00
ldm0 a9830ab24b fix(csp): reject nonnonceable script elements
Apply the shared script nonceability check to parser scripts, buffered preloads and runtime script preparation. Suspicious script attribute names and values must not authorize execution merely because a nonce matches. Includes parser, preload and dynamic-preparation regressions.

The attribute checks follow the [CSP3 nonceability algorithm](https://www.w3.org/TR/CSP3/#is-element-nonceable), including case-insensitive `<link`, `<script` and `<style` matches and parser duplicate attributes.

Validation: all branch checks passed. Summary [ 115.690s] 18925 tests run: 18925 passed (9 slow), 16 skipped
2026-09-29 16:27:50 +08:00
ldm0 e4d923c421 fix(import-maps): reuse inline source validation before registration 2026-09-28 01:30:21 +08:00
ldm0 929f73b148 fix(events): keep shared event state in private V8 backing 2026-09-26 01:38:23 +08:00
ldm0 9916039eb8 fix(dom): create AbortSignals with intrinsic factories and typed arguments 2026-09-24 16:44:14 +08:00
Donough Liu 04ac476e66 fix(events): share AbortSignal EventTarget dispatch (#769) 2026-09-23 04:44:38 +08:00
ldm0 577aef69e0 fix(timers): retain the initiating script nonce
Snapshot the initiating script nonce when scheduling string timeouts and intervals, then restore it on the compiled timer source. Cover dynamic imports, nested timers, identical source scheduled under different nonces, and functions invoked by another script.
2026-09-18 00:34:11 +08:00
ldm0 c689e4adf8 fix(modules): expose inline import meta base URLs
Compile inline modules with their document base URL and read import.meta.url from the V8 module resource name. Preserve separate internal module-map identities and cover both page and child inline modules.

Source: f8de9b7ed0
2026-09-16 16:17:55 +08:00
ldm0 053d3f604d refactor(v8): centralize JavaScript execution boundaries
Own callback microtask nesting in with_webidl_callback_contexts so operation
lookup, invocation, and return conversion share one boundary. Exit the
incumbent scope before Scoped-policy checkpoints and preserve Auto timing.

Route scripts, functions, modules, and constructors through named renderer
entry points, including worker execution. Keep the generic scope helper
private and remove manual callback wrappers from callers.

Cover microtask policies, exception cleanup, and incumbent cleanup ordering
with regression tests. Guard script and module execution entry points with
the existing source inventory checks.

Validation:
- cargo fmt --all
- cargo clippy --workspace --all-targets --all-features -- -D warnings
- cargo nextest run --no-fail-fast
2026-09-16 14:59:42 +08:00
ldm0 1b214ad088 fix(custom-elements): checkpoint only outside active JavaScript
Expose native MicrotasksScope bindings and use them explicitly at Moli script, module, callback, constructor, and popup execution boundaries. Keep rusty_v8 call APIs unchanged.

Checkpoint custom element constructors before validation only when no outer script or microtask is active. Cover parser, document.write, createElement, and host-owned popup execution; update the document.write reaction-order regression.
2026-09-16 14:59:42 +08:00
ldm0 e45aad07a6 test(renderer): scope short script watchdog timeout
Source: f316f7ecf9
2026-09-14 21:54:28 +08:00
ldm0 416936f732 fix(modules): enforce import-map integrity
Source-commit: 259f7aaa46
2026-09-12 06:40:39 +08:00
ldm0 a7160b75ac refactor(webapi): rename record role to plain 2026-09-12 01:38:23 +08:00
ldm0 2e6167f127 refactor(webapi): make object roles and receiver identity explicit 2026-09-12 01:38:23 +08:00
ldm0 a70a96f9d1 fix(cdp): synchronize Navigator emulation through native state 2026-09-09 05:02:43 +08:00
ldm0 017c53de8c build(v8): migrate Moli to V8 15.2 2026-09-03 15:17:48 +08:00
ldm0 c0e189a0fb fix(renderer): defer idle callbacks while page work is pending 2026-08-30 16:36:55 +08:00
ldm0 2bead09773 fix(v8): handle non-string function names 2026-08-27 02:04:06 +08:00
ldm0 28aaaa9e8a feat(cli): add disable-js fetch mode 2026-08-25 16:05:34 +08:00
ldm0 d5e41805f6 refactor(renderer): bind document task capabilities atomically 2026-08-21 18:22:47 +08:00
ldm0 9e04a203d7 refactor(renderer): bind prepared scripts to exact document owners 2026-08-21 11:23:44 +08:00
ldm0 530e9ae592 refactor(renderer): bind host scripts at document admission 2026-08-21 11:23:44 +08:00