Commit Graph
1761 Commits
Author SHA1 Message Date
ldm0 67fd39fb4a fix(webidl): finish dictionary ordering migration
Convert inherited EventInit fields before ICE error event payload members. Update the video decoder getter trace to match lexical dictionary member ordering.
2026-10-10 14:36:55 +08:00
ldm0 a3784688b7 fix(fetch): cancel raw downloads for unsupported output 2026-10-10 14:36:55 +08:00
lanyue-llk cc6c5ab684 test(canvas): use the default runtime context 2026-10-10 13:44:31 +08:00
ldm0 a423ba43b1 feat(webidl): derive dictionary member order and inheritance
Derive dictionary member conversion in lexical order and add explicit #[webidl(inherit)] support that converts ancestor dictionaries before derived members. Migrate the existing native EventInit-based dictionaries together so sorting does not mix inherited and own members. Reject incompatible inheritance attributes and duplicate own member names. V8 integration tests cover aliases, nested and inherited dictionaries, Proxy/getter traces, early exceptions and coercion ordering. Native renderer regressions cover twelve event constructors in two realms, flag preservation, and ancestor getter exceptions preventing all derived reads.
2026-10-10 13:43:23 +08:00
ldm0 7e93cca631 fix(indexeddb): validate native schema key paths before mutation
Validate native object-store and index schema key paths using Unicode identifier rules, including dotted paths and sequences. Preserve syntax/duplicate/invalid-option precedence and reject invalid metadata before mutating the backend. Map native Syntax and InvalidAccess errors to their DOM names. Tests cover Unicode paths, invalid sequences and failed creations leaving metadata unchanged. Renderer argument/receiver migration is separate.
2026-10-10 12:09:13 +08:00
ldm0 aaa5e747af fix(canvas): apply transforms and native conversion to fillRect
Validate fillRect receivers with shared brands before required numeric conversion. Rasterize transformed rectangles through the existing paint path, preserving the default path and compositing/alpha behavior; nonfinite or zero-area inputs and singular transforms draw nothing. Tests cover Window, child realm and Worker OffscreenCanvas, conversion order, negative sizes and transformed pixels.
2026-10-10 12:07:55 +08:00
ldm0 74b0a83ec2 fix(abort): release native roots after signal termination
Keep completed AbortSignal objects weakly referenced in native Window and Worker registries, and read Worker abort reasons from the signal's native private slot. Keep the synchronous dispatch snapshot alive through abort steps, reuse the controller's already initialized signal identity, and preserve live reasons and dependent signal behavior. GC regressions cover abandoned reference cycles and reasons still reachable from JavaScript.
2026-10-10 12:01:33 +08:00
ldm0 ae20434893 perf(accessibility): build request projections on demand 2026-10-10 11:53:21 +08:00
ldm0 5a87700637 test(puppeteer): cover accessibility visibility workflows 2026-10-10 11:53:21 +08:00
ldm0 4997e6d0d3 fix(accessibility): project computed visibility and composed names 2026-10-10 11:53:21 +08:00
ldm0 10fa77c49f test(puppeteer): cover shadow accessibility workflows 2026-10-10 11:53:21 +08:00
ldm0 37e8bf746c fix(accessibility): include shadow controls in AX snapshots 2026-10-10 11:53:21 +08:00
ldm0 aeabb8b9e8 fix(cssom): convert declaration values before mutation
Perform WebIDL string conversion before mutating live, detached, rule, and computed CSS declarations. Preserve thrown coercion values and run conversion before readonly errors; re-resolve native state after reentrant author code. Regressions cover named attributes, cssText, setProperty ordering, null and undefined, and exception identity. Resolve regression bindings from actual CSS object prototypes so legacy popup facades are exercised without requiring the separate popup-global constructor feature.
2026-10-10 04:00:56 +08:00
ldm0 579e180545 fix(indexeddb): preserve first primary keys in reverse unique cursors
Deduplicate the ascending index entries before reversing unique cursor traversal. Previously prevunique chose the last primary key in each duplicate index-key group. Preserve ordinary reverse traversal and cover multiple duplicated index keys in native cursor tests. Update the existing JavaScript cursor and collection regressions to assert the corrected primary-key choice.
2026-10-10 03:59:29 +08:00
ldm0 2c8f19277b fix(xml): validate numeric references using the XML Char production
Validate XML numeric character references using the XML Char production rather than HTML recovery rules. Keep carriage returns and C1/noncharacter values which XML permits, and reject forbidden controls/surrogates. Parser regressions cover decimal and hexadecimal references and retain strict failures.
2026-10-10 03:44:51 +08:00
ldm0 658bc8fcb4 fix(fonts): settle document fonts ready after loading and layout invalidation
Validation on this branch: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings.
Nextest and WPT reruns omitted at the user's request.

Includes the ablation-confirmed cleanup from 0e3ce99dcf.
2026-10-10 03:39:54 +08:00
ldm0 e87d039017 fix(dom): require owning hosts for native bridge identity
Fail reflector lookup when the wrapper's creation context has no native host,
instead of resolving its local ID through the caller's bridge. Require a host
for the current context before reading the wrapper cache or creating wrappers.

Cover colliding reflector IDs from an unowned V8 context and wrapper
materialization without a host, while preserving genuine wrapper identity.
The existing opener/popup adoption regression also passes.

Compared Chromium ScriptState::ForRelevantRealm and ToScriptWrappable: native
identity remains attached to the object and missing context data does not
select the caller's identity store.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets
--all-features -- -D warnings; cargo nextest run --no-fail-fast.
Nextest: 19705 passed, 16 skipped, 32 threads, no retries.
2026-10-10 03:34:22 +08:00
ldm0 78f43c201b fix(dom): resolve foreign reflectors in their owning page
Validation on this branch: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings.
Nextest and WPT reruns omitted at the user's request.

Includes the ablation-confirmed cleanup from c1fe3ea895.
2026-10-10 03:34:22 +08:00
ldm0 6f2a5b1505 feat(webtransport): expose secure owned stream interface objects 2026-10-10 01:06:14 +08:00
ldm0 8db17d4e35 test(webauthn): use the default runtime context 2026-10-10 01:04:25 +08:00
ldm0 fb8b9b7a8c fix(geometry): check DOMRectList.item bounds before array lookup
Return null for out-of-range DOMRectList.item indices after WebIDL argument
conversion. Avoid looking up inherited numeric Array.prototype values or
invoking inherited getters on the private backing array.

Cover empty and nonempty Element/Range lists, boundary and negative indices,
inherited values and getters, and argument conversion side effects with a
Chromium-calibrated regression test.

Validation:
- cargo fmt --all
- cargo clippy --workspace --all-targets --all-features -- -D warnings
- cargo nextest run --no-fail-fast: 19,723 passed, 16 default skipped, no retries
- cargo build --release --locked -p moli
- Release item bounds probes match Chromium in main and isolated worlds
- Full release CDP smoke: 52/52 passed with --jobs 4, including Puppeteer
2026-10-09 21:09:41 +08:00
ldm0 3f66c3d8b3 fix(geometry): make DOMRectList iterable
Expose Array.prototype.values as DOMRectList's default iterator so
Puppeteer position clicks can spread Element.getClientRects() results.

Cover empty and nonempty Element/Range lists, iteration identity,
iterator property descriptors, and generic array-like receivers.
2026-10-09 21:09:41 +08:00
ldm0 86dbfcafea fix(geometry): return branded DOMRectList objects
Return DOMRectList from Element and Range geometry queries, including empty results. Provide the prototype, item lookup, indexed property descriptors, and rejection of structured cloning. Preserve pending layout exceptions while constructing fallback results.

Source: 6d603dfc03
2026-10-09 21:09:41 +08:00
ldm0 cda25f9339 fix(webauthn): add native credential members and capability queries 2026-10-09 21:07:47 +08:00
lanyue-llk b75fdf88f9 test(gamepad): use the default runtime context 2026-10-09 20:21:47 +08:00
ldm0 19f388b4f1 feat(webcodecs): expose secure video encoder and decoder interface shells 2026-10-09 19:38:54 +08:00
ldm0 859b140619 feat(gamepad): expose native interfaces and event payloads
Expose Gamepad, GamepadButton and GamepadHapticActuator native interface shells, with shared GamepadEvent construction and a branded gamepad payload retained by identity. Polling continues to report no connected devices; actuator operations reject because there is no device backend.

Regressions cover exposure in Window and child realms, worker absence, descriptors, dictionary conversion order, native and registered-proxy brands, rejection of forged receivers, event dispatch and Promise/error realms.
2026-10-09 19:38:10 +08:00
ldm0 622fbed53b feat(webaudio): unify native AudioNode interfaces
Expose AudioNode as the shared native EventTarget parent of the existing audio node interfaces. Move context, port/channel properties and connect/disconnect to its branded prototype, and keep node state in private slots. Validate graph arguments before checking connection state and define native edge-array entries without invoking author setters.

Regressions cover inherited descriptors, genuine and forged receivers, cross-realm nodes, conversion order, channel options and worker absence. The existing audio graph implementations continue to provide node creation and rendering.
2026-10-09 19:36:56 +08:00
ldm0 c5d665cad8 feat(webrtc): construct ICE error events with native fields 2026-10-09 19:33:55 +08:00
ldm0 ae1aeb37f4 feat(webrtc): implement native RTCError and RTCErrorEvent 2026-10-09 19:32:03 +08:00
ldm0 7fc70a2409 feat(cssom): expose missing properties with CSS-wide keywords 2026-10-09 19:09:15 +08:00
ldm0 ea94f86c70 fix(webidl): expose readonly ResizeObserver result snapshots 2026-10-09 19:08:11 +08:00
ldm0 e768ed37de fix(events): gate raw pointer update handlers on secure contexts 2026-10-09 19:06:50 +08:00
ldm0 3f17ed760f feat(events): expose missing native Window and DOM handlers
Exposes the missing native Window event-handler accessors, including the 41 inventory names, and completes the matching DOM global-handler property list. Adds secure-context-only device motion/orientation handlers, using the trusted realm exposure decision rather than the author-visible isSecureContext property.

Tests cover main/iframe descriptors, native callback identity, cancellation, clearing, DOM selection handlers, secure/insecure exposure, borrowed accessors, and invalid receivers. The extraction uses current main's existing handler backend. The separate body/frameset forwarding, popup realm migration, vendor event-name normalization, listener/handler ordering overhaul, and document-open reset behavior are not claimed by this PR.
2026-10-09 19:06:50 +08:00
ldm0 fe54d7ea10 fix(renderer): update tests to use Window realm runtime context 2026-10-09 18:03:31 +08:00
ldm0 aefc621d97 refactor(renderer): give every Window realm an execution owner
Create the execution owner before fallible bootstrap and move it intact through prebootstrap and registration. Queue abandoned owners for cleanup outside V8 callbacks and release retired WindowProxy helper surfaces. Cover failed bootstrap, promotion, deferred cleanup, and Context reclamation.
2026-10-09 18:03:31 +08:00
ldm0 badd0a4eb1 fix(renderer): close execution resources for every Window realm 2026-10-09 18:03:31 +08:00
ldm0 650a15fa7e fix(streams): preserve stored errors across array prototype changes
Create the internal error container with an own element directly. Setting index zero on an empty array could consult an author-defined inherited property and replace the original rejection value. Cover Response.clone().text() with a read-only inherited array index.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast (19,655 passed, 16 skipped); cargo build --release -p moli.
2026-10-09 18:03:31 +08:00
ldm0 0aeae423d2 perf(v8): read intrinsic tables from traced Context data
Store the JS identity array in a reserved tagged Context embedder-data slot, initialized with the registry. This preserves Context ownership and detached-realm collection while avoiding private-symbol lookup on each access.

A local release comparison found about 4.8% overhead for DOM creation with the private-field table. Direct Context access brought the same workload back within baseline variation.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast (19,654 passed, 16 skipped); cargo build --release -p moli.
2026-10-09 18:03:31 +08:00
ldm0 3b9003b326 refactor(fetch): keep body errors in the readable stream
Read original rejection values from the stream's existing JS state through the native body's weak stream reference. Remove the duplicate long-lived error handle and its navigation-time conversion, without adding another state object or weak handle.

Cover collection of unread errors while the native body table remains alive, foreign-realm error identity, and primitive errors on clones created before and after failure.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast (19,654 passed, 16 skipped).
2026-10-09 18:03:31 +08:00
ldm0 71645e553c refactor(v8): let contexts own Web API intrinsic identities
Store constructors, prototypes and public interface objects in a Context-owned private array. Keep only publication metadata in Rust and remove the navigation-time handle conversion. Verify identity across detachment and collection while Rust metadata remains alive.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast (19,651 passed, 16 skipped).
2026-10-09 18:03:31 +08:00
ldm0 94570ff379 feat(fetch): add HTTP failure flags with status-aware errors
Add mutually exclusive --fail and --fail-with-body flags for the final
main document, returning exit 22 for completed HTTP errors. Keep selected
output by default; --fail suppresses it and cancels raw error downloads,
while --fail-with-body retains the selected output format.

Preserve known HTTP status and final URL when readiness or output fails.
With --fail, a known HTTP error takes priority; with --fail-with-body,
processing errors retain exit 1. Judge challenge redirects by their final
page and keep Fetch/XHR and subresource HTTP handling unchanged.

Cover CLI parsing and the HTTP failure contract with regression tests for
formats, raw downloads, redirects, readiness, evaluation, output I/O,
empty Markdown, and stalled response bodies.
2026-10-09 16:15:12 +08:00
ldm0 998203fbe9 feat(core): support skipping raw response bodies by status
Add MaterializeBelowStatus so document callers can return raw response
metadata and cancel the download from its headers. Apply the same policy
to network and service-worker responses while preserving the existing
Materialize and RequirePage behavior.
2026-10-09 16:15:12 +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 a7ce9db918 fix(csp): check the initiator before javascript URL navigation
Validation on this branch: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings.
Nextest and WPT reruns omitted at the user's request.
2026-10-09 02:52:24 +08:00
ldm0 0281dcf3e6 fix(window): synchronize Location when reusing the initial Document
Validation on this branch: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings.
Nextest and WPT reruns omitted at the user's request.
2026-10-09 02:51:31 +08:00
ldm0 497f4d275e fix(history): give initial auxiliary documents one history entry
Validation on this branch: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast.
2026-10-09 02:47:39 +08:00
ldm0 5c44cd6eff refactor(encoding): rename shared document streaming decoder 2026-10-09 01:59:04 +08:00
ldm0 c884fe059b fix(fonts): validate binary FontFace payloads after descriptor conversion 2026-10-08 23:38:02 +08:00
ldm0 a221393a4f fix(geometry): preserve point dictionary conversion order
Convert DOMPointInit members in lexical order, reading and converting w before x, y and z. Derive the optional getCharNumAtPosition dictionary argument, expose its length as zero, and validate its native SVGTextContentElement receiver before conversion. Regressions cover inherited/Proxy dictionaries, getter and numeric conversion exceptions, defaults, receiver checks, and the existing DOMPoint.fromPoint, DOMMatrix.transformPoint and SVG callers in main and child realms and windowless documents. The text receiver cases cover main's existing SVGTextElement and SVGTSpanElement interfaces.
2026-10-08 21:44:33 +08:00