Commit Graph
4918 Commits
Author SHA1 Message Date
ldm0 e22fac47c4 fix(dom): validate ShadowRoot members with native receivers
Use generated receiver checks for ShadowRoot members and Text.assignedSlot,
and expose enumerable ShadowRoot and slot operations. Share stylesheet
caches through the native backing identity and private slots so registered
native proxies remain usable without invoking author traps.

Cover borrowed bindings, callee-realm TypeErrors, forged/revoked/author
proxies, conversion ordering and genuine roots across live, windowless and
XML documents. Exercise registered native proxies in both realms.
2026-11-20 22:47:55 +08:00
ldm0 187130dec4 refactor(csp): share parsed policies across inherited request snapshots
Adapt document projections, popup activation, worker policy iteration and
navigation snapshots to the shared ContentSecurityPolicy type. Retain meta
policy provenance and reporting rules, and keep mutable creator lifecycle
state in the renderer. Place iframe source-list subsumption beside the
shared checks and preserve its existing regression coverage.
2026-11-20 22:47:55 +08:00
ldm0 d7ef962f02 fix(fetch): retain native curl extensions with main header parsing
Port the upstream browser-response-headers feature, build adapter and C shim into the bundled libcurl. Keep the existing TLS EOF behavior and native connection timing while exposing the framing and header semantics required by main.
2026-11-20 22:47:55 +08:00
ldm0 f373fc64f3 refactor(css): adapt native consumers to Stylo 0.22
Use owned parser errors and typed math payloads, keep the 128-level numeric parsing limit and preserve RangeError classification. Pin the native font shorthand port on Stylo 0.22 instead of adding callback exceptions.
2026-11-20 22:47:55 +08:00
ldm0 fde47a68f1 fix(dom): bind ParentNode members to their owning interfaces
Use native receiver guards for Element and DocumentFragment mixin members,
including DocumentFragment.getElementById. Let detached wrappers and
ShadowRoot inherit canonical methods instead of reinstalling unguarded
forwarders with different metadata and identities.

Resolve registered Node proxies through their native backing object while
preserving pre-branding factory reads. Keep detached mutation synchronization
and create querySelectorAll results in the receiver realm without changing
the realm of selector exceptions. Mirror adoption delegates on native Proxy
backings while retaining canonical detached-tree identities.

Cover owner interfaces, cross-realm borrowing, conversion ordering, native
proxies, forged receivers, static/live collections and ShadowRoot inheritance.
2026-11-20 22:47:55 +08:00
ldm0 7bf1b354ca fix(build): reconcile definitions after main integration
Keep one copy of the image and Trusted Types regressions, native Document
charset setter and MessagePort test registration. Retain the stronger
policy regression and reuse the shared setter when initializing parsed
Document metadata. Avoid setting the child Document charset twice.
2026-11-20 22:47:55 +08:00
ldm0 e6aa4d1549 test(dom): require UTF-8 for srcdoc native documents
A srcdoc response supplies Unicode markup and is parsed as UTF-8 even
when the parent Document has a legacy charset. Match Chromium 152 and
keep the existing GBK mutation, cloning and per-Document isolation checks.
2026-11-20 22:47:55 +08:00
ldm0 c57dc1a6f9 fix(events): derive CustomEvent initialization and prototype detail
Expose detail through the native CustomEvent prototype declaration and
validate receivers with the shared interface brand. Keep arbitrary payload
values in the private event backing without projecting or copying them.

Convert inherited EventInit and raw CustomEventInit members through the
shared dictionary derive before initializing state. Preserve exceptions,
getter order, empty dictionary defaults and legacy initialization semantics.

Cover cross-realm descriptors, abrupt conversions, author and registered
native Proxies, windowless Documents and author-modified prototypes.
2026-11-20 22:47:55 +08:00
ldm0 774a22ebd2 fix(dom): expose immutable MutationRecord prototype attributes
Keep record values in private slots and expose the nine readonly attributes
through branded prototype getters. Preserve snapshot identity across realms,
shadow properties, registered native Proxies, and retained records.

Create delivery arguments in the callback function's relevant realm so
MutationRecord wrappers and arrays use the correct prototypes.
2026-11-20 22:47:55 +08:00
ldm0 7b3cd95375 fix(webidl): wrap native Promise arguments in fresh capabilities
Create a new callee-intrinsic Promise capability for every Web IDL Promise
conversion, including native Promise inputs. Resolve it with the input so
then lookup, asynchronous then calls and rejections follow V8's algorithm.

Cover realm and object identity, author-replaced public Promise constructors,
throwing then getters, revoked Proxies, scalar inputs, required arguments
and per-entry record conversion order. Require all 378 existing Payment
checks to pass instead of expecting the 16 native-Promise wrapping gaps.
2026-11-20 22:47:55 +08:00
ldm0 ea07e89d00 fix(webmcp): separate submission and response lifetimes
Cancel same-stack form removal after requestSubmit for every respondWith
input, while retaining responses captured during submit dispatch or already
handed to asynchronous response processing. Track submission phases through
a native microtask continuation instead of inspecting Promise state.

Cover scalar, fulfilled and pending native Promise, and thenable responses,
manual and automatic submission, and late resolution after cancellation.
Keep the existing form unmount and original WebMCP WPT assertions intact.
2026-11-20 22:47:55 +08:00
ldm0 5a6b872e91 refactor(media): derive metadata dictionary sequences 2026-11-20 22:47:55 +08:00
ldm0 5f34319d4b refactor(cache): use derived request argument conversion 2026-11-20 22:47:55 +08:00
ldm0 a8c8a4f6d7 refactor(payment): use typed dictionary snapshots 2026-11-20 22:47:55 +08:00
ldm0 f567c827c0 fix(runtime): retain popup replacement lifecycle during owner startup
Keep a lifecycle resident already bootstrapped for a foreign document.open
operation's exact target Document. Its later close action resumes that driver
instead of retiring it or clearing the target Document's queued work.

Cover open-before-owner-bootstrap followed by a separate close, including
exact admission ownership and reactivation of the parked resident.
2026-11-20 22:47:55 +08:00
ldm0 593fd166a4 fix(forms): preserve sandbox admission for planned navigations
Resolve existing ancestor targets through the native navigation model before
formdata can replace the source Document, retaining main's sandbox admission
checks alongside queued and cancellable form submission.

Run the inherited sandbox matrices through the Page task executor. Preserve
all cases and permission assertions, and cover same-origin POST interception
as supported by the Navigation API and verified in Chromium 152.
2026-11-20 22:47:55 +08:00
ldm0 2653b342b1 fix(runtime): complete document replacements across Page owners
Retain the exact open/close action made by another Page and wake its lifecycle owner. Coalesce consecutive replacements without letting an unrelated action consume an older admission.

Resolve event callbacks through their own Context runtime binding so lifecycle listeners from other Page hosts are invoked and report exceptions in the correct Window.

Cover real HTTP popup replacement from root, iframe, popup and self, later close and repeated open/close, plus stale admission and coalescing authority.

Validation: cargo fmt --all; full workspace all-targets/all-features clippy -D warnings; cargo nextest run --no-fail-fast (22,989 passed, 17 existing skips, 32 threads, zero retries).
2026-11-20 22:47:55 +08:00
ldm0 cdbecb7f13 fix(dom): resolve document.open entry Documents across Page hosts
Retain the native entry Document instead of a host-local node handle, then
read its URL through native ownership after removal callbacks. Reuse the
canonical wrapper in its realm without reading author URL properties.

Apply the same entry reference to root, child and lightweight popup streams,
retaining strict origin checks and fragment handling for the same Document.
2026-11-20 22:47:55 +08:00
ldm0 875d7b946e fix(csp): restore local document policies from history
Retain creation-time policy snapshots by Document identity for local history
restoration, independently of about:blank origin and Window authority.
Initialize each new Document with the resolved policy before inherited meta
CSP delivery; preserve fresh navigation and later creator/target meta behavior.
2026-11-20 22:47:55 +08:00
ldm0 1c17d30113 fix(navigation): preserve activation source Document provenance
Carry source lifecycle through shared history seeds, native requests, and
private activation state. Project from using the committed Document origin
so initial, inherited, cross-origin, and opaque sources stay distinct.

Record child Document origins at commit and retain the traversal visibility
boundary. Cover 19 real HTTP scenarios and the current upstream initial
about:blank WPT on both HTTP and HTTPS.
2026-11-20 22:47:55 +08:00
ldm0 2799af7af3 fix(navigation): retain activation across native history snapshots
Capture the associated private state when synchronizing child history, so
readonly attributes and author shadows cannot erase or replace activation.
Restore its entry by identity even after same-document history changes.

Cover normal, shadowed and frozen objects and recreate their structured
state after source-isolate teardown using real HTTP child Documents.
2026-11-20 22:47:55 +08:00
ldm0 305739b9c8 fix(navigation): expose readonly activation and transition state 2026-11-20 22:47:55 +08:00
ldm0 19a546ecb2 fix(navigator): preserve native plugin collection semantics 2026-11-20 22:47:55 +08:00
ldm0 d6ce3925f5 fix(navigator): expose UAData attributes with native snapshots 2026-11-20 22:47:55 +08:00
ldm0 b296f1959e fix(csp): carry initiator policies through local document navigation 2026-11-20 22:47:55 +08:00
ldm0 8e3a80c89c fix(csp): snapshot meta policies for cross-realm Location navigation 2026-11-20 22:47:55 +08:00
ldm0 9212a6c562 fix(csp): preserve policy ownership across document input stream resets 2026-11-20 22:47:55 +08:00
ldm0 8c003f5734 fix(csp): install inherited meta policies for related initial documents 2026-11-20 22:47:55 +08:00
ldm0 7706222b93 feat(csp): enforce iframe source-list requirements at navigation
Retain inherited requirements and the embedding origin at navigation admission.
Accept responses through Allow-CSP-From or source-list subsumption, preserving
nonce privacy, explicit/default port syntax and the policy origin for local URLs.

Commit blocked responses as opaque error Documents through the existing owner
lifecycle. Preserve WindowProxy identity and real Network facts while masking
public response timing. Restore local-scheme history with its original policy,
and share installed request-policy snapshots without changing bypass semantics.

Validation: cargo fmt --all; workspace all-targets/all-features clippy with
-D warnings; 22,952 nextest passes with 32 threads and zero retries (17 existing
skips). All 321 unchanged original WPT subtests pass (+80); 51 controlled cases
match Chromium 152. Original CSP fixture files and existing passed test IDs
remain unchanged.
2026-11-20 22:47:55 +08:00
ldm0 dd250370cd feat(csp): snapshot iframe requirements on navigation requests
Validate iframe CSP attribute transport syntax and retain the policy with
the admitted navigation target. Preserve it through deferred commits, owner
refreshes, history seed rollback and form/Location navigation rather than
reading mutable owner attributes when the fetch eventually starts.

Set one authoritative Sec-Required-CSP value on the child navigation request,
remove stale/forged duplicates without changing other raw header fields,
and preserve redirect propagation. Keep DOMString reflection unchanged and
reject CRLF injection, reporting directives and oversized attribute values.

Carry pending attribute navigation as a typed snapshot instead of a boolean
and thread the complete native navigation record through bootstrap/load.
Cover header safety, authoritative field replacement and admission-time
policy retention using real child navigation response terminals.
2026-11-20 22:47:55 +08:00
ldm0 deb848323c refactor(webcodecs): initialize color metadata from dictionary snapshots
Use the shared WebIdlArgs dictionary converter for VideoColorSpaceInit and
map its generated snapshot writes onto the existing native private slots.
Constructor and native VideoFrame color producers now share one typed schema
without separate enum label tables or nullable-value assembly.

Keep constructor identity in the existing native constructor adapter and
native producer branding in the interface declaration. Preserve codec
configuration snapshot order and the separate toJSON property order, using
the container-level data_properties declaration for ordinary JSON results.
2026-11-20 22:47:55 +08:00
ldm0 3a0515d6e8 fix(performance): retain null-body iframe navigation timing
Carry the real network snapshot through ignored child navigation outcomes.
Report accepted frame-owner 204/205 fetches when timing is allowed, without
replacing the active Document, advancing history or dispatching load. Keep
downloads, unsupported MIME types and failed-TAO no-commit responses out of
the Resource Timing buffer.

Reuse one native frame-owner timing record for committed and ignored loads,
keep null-body representation metadata empty, and preserve historical Network
facts without letting stale completions affect replacement owners. Cover
204/205 status, TAO, Document identity, history and stale-owner delivery using
real response terminals.
2026-11-20 22:47:55 +08:00
ldm0 1835bad26f fix(performance): retain iframe attribute navigation provenance
Keep queued child navigation bootstrap, initiating URL and initiator kind in
one native record. Preserve frame-owner provenance when an already loaded
iframe uses the shared history/navigation machinery, without reporting child
Location or history navigations as parent resource fetches.

Route null-namespace src writes through the same iframe navigation helper and
retain the original UTF-16 attribute units while parsing the network URL.
Cover repeated URLs, cross-origin TAO, nested owner realms, load reentrancy,
Location navigation and lone surrogates in 58 fixture scenarios.
2026-11-20 22:47:55 +08:00
ldm0 06f8b5c6a0 fix(performance): expose native resource connection timing
Retain selected socket and TLS observations through libcurl connection reuse,
HTTP/2 multiplexing and transfer retirement using the Rust monotonic clock.
Keep final-hop fetch time separate from physical connection creation, including
redirect preflights, and project through the existing branded resource slots
and native data-property JSON declarations.

Carry native timing into synchronous XHR and child-document resources while
preserving CORS/TAO filtering, lazy realm delivery and cache provenance.
Retire completed head-only responses without aborting reusable connections;
continue cancelling unfinished preflight and redirect bodies immediately.

Cover physical connection reuse, proxy TLS ordering, shared DNS, native JSON
snapshots, lazy main/child realms and held redirect preflights.
2026-11-20 22:47:55 +08:00
ldm0 f4889ee077 feat(fetch): retain native connection setup observations
Carry shared DNS start/completion through the curl scheduler, preserving the
resolver clock across owner delivery, queue retirement and active completion.
Record TLS setup and request-preparation callbacks on each transfer's own
progress token; preserve curl-rust's default TLS certificate initialization.

Capture unrounded curl statistics once at terminal completion and reuse them
for logging. Expose partial typed observations to buffered, raw and HTML
consumers, keeping unavailable data distinct from native zero and from the
Web Resource Timing projection.

Cover DNS provenance, cache/redirect isolation, delayed consumption, HTTP/2
multiplexing and proxy tunnel ordering.
2026-11-20 22:47:55 +08:00
ldm0 ef2bf20a0d fix(csp): discard invalid values without reviving duplicate directives
Ignore directives containing non-whitespace controls, DEL or non-ASCII
characters. Reserve the first directive name even when its value is ignored,
so later duplicates cannot replace it or bypass a valid default-src fallback.

Cover header/meta parsing, independent directives, reporting, Trusted Types
sinks and worker string/Wasm compilation. Keep source-token boundary checks
separate from invalid directive handling.
2026-11-20 22:47:55 +08:00
ldm0 fdca3424ea fix(xhr): keep open exceptions in the invoked method realm
Throw inactive-owner and unavailable-context InvalidStateError in the
open method's realm, as the existing WebIDL binding requires. Keep the
XHR owner's native base URL and query encoding lookup after argument
conversion without switching exception construction to the caller realm.
2026-11-20 22:47:55 +08:00
ldm0 2c0ff05347 test(media): run video decode actors on the worker pool
Use the production-shaped multithreaded resource executor while LocalSet retains the V8 caller thread. Preserve all 192 cross-realm and ownership checks and the existing JavaScript timeout.
2026-11-20 22:47:55 +08:00
ldm0 1274a858f7 test(animation): preserve native metadata in scan regression 2026-11-20 22:47:55 +08:00
ldm0 dc95c1da9d test(cdp): adapt captured navigation bodies to Base64 2026-11-20 22:47:55 +08:00
ldm0 e773f6f8d0 fix(media): derive capability configuration snapshots 2026-11-20 22:47:55 +08:00
ldm0 83a6e7eb6f fix(css): preserve supports query token semantics 2026-11-20 22:47:55 +08:00
ldm0 1ff8ad9952 fix(cssom): serialize computed background layers
Serialize computed background from the shared retained style read, using the image list to coordinate layers, repeating or truncating other component lists, and emitting color only in the final layer. Include computed initial components instead of using specified-value shorthand elision.

When Stylo cannot serialize a computed shorthand, reify the shared CSSOM result as one property-associated opaque CSSStyleValue. Preserve native realm allocation, snapshot immutability and longhand Typed OM types. Cover multiple layers, currentcolor, list coordination, private native writes and cross-realm reads.
2026-11-20 22:47:54 +08:00
ldm0 eeba5210ee fix(images): truncate fractional raster natural dimensions
Project density-corrected raster natural dimensions to integer CSS pixels by truncating rather than rounding. A decoded 1x1 image at 1.5x or 2x density must expose zero natural dimensions; at 0.4x it must expose two.

Keep SVG concrete-size rounding, floating-point intrinsic sizes and the image load/decode lifecycle intact. Centralize the integer projection at the resource store, where decoded image metadata distinguishes raster and SVG. Cover four explicit densities with real intercepted GIF responses.
2026-11-20 22:47:54 +08:00
ldm0 9c74c751e5 fix(images): parse source sizes with shared CSS primitives
Replace comma/string splitting with CSS component parsing and shared Stylo length math and media conditions. Resolve sizes against the owning document viewport, initial font metrics and emulated media features. Validate computed math before property clamping and retain fractional CSS pixels.

Canonicalize zero source sizes, including negative zero, to positive infinite density so request keys cannot abort the renderer. Keep existing auto sizing behavior while requiring an exact leading CSS auto identifier. Cover CSS boundaries, media conditions, non-finite math, request reuse and successful decode without layout.
2026-11-20 22:47:54 +08:00
ldm0 d14b3a5dc0 refactor(webrtc): derive session description snapshots
Use one typed RTCSessionDescriptionInit schema for constructor conversion, native factories, private backing and fresh JSON results. Reuse the RTCSdpType enum and retain UTF-16 SDP, lexical input conversion and the existing type/sdp output order.

Resolve registered native Proxy receivers through shared identity before reading the private snapshot. Keep returned dictionaries independent and emit fixed local-description payloads through the data_properties declaration.
2026-11-20 22:47:54 +08:00
ldm0 0e2e4cf701 fix(images): honor picture source MIME type hints
Skip unknown and unsupported source MIME hints before selecting a picture candidate. Use the shared WHATWG MIME parser and actual image codec capabilities, retaining empty hints and null-namespace attribute semantics.

Cover fallback, same-request preservation, type changes, real icon resources, and activation after adoption from an inactive Document. The unchanged source-selection WPT cohort improves from 83/103 to 103/103, matching Chromium.
2026-11-20 22:47:54 +08:00
ldm0 5c1e91a472 feat(images): decode bounded ICO resources
Admit ICO in the shared image capability table and decode real PNG and BMP directory frames. Keep PNG frames on the existing bounded color-managed codec, with an explicit orientation policy so embedded Exif does not rotate ICO frames. BMP frames retain palette and AND-mask decoding.

Cover real pixels, directory selection, precision, malformed entries and metadata-only probing. Retain unsupported-format rejection using TIFF now that ICO is supported.
2026-11-20 22:47:54 +08:00
ldm0 faa06ab48a fix(cdp): adapt navigation to optional runtime owner slots
Use the updated optional owner slot API when preparing beforeunload and completing navigation. Include the operation and case in ancestor-navigation realm assertion diagnostics.
2026-11-20 22:47:54 +08:00
ldm0 f267b43fec fix(runtime): integrate typed API state and Window ownership with main
Reconcile API dictionary snapshots and data properties with main, and migrate frontend listener state to the shared native EventTarget machinery. Preserve native proxy dispatch identity and validate callbacks in their captured execution context.

Use the shared cross-origin Window and Location infrastructure while retaining callee-realm errors, entry and incumbent navigation settings, lazy child contexts and document-order named access. Update regression fixtures for native task ownership and published geometry; retain all matrix assertions and compare video frame pixels directly without stringifying them.
2026-11-20 22:47:54 +08:00