Commit Graph
3888 Commits
Author SHA1 Message Date
ldm0 f2abbf0d90 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-03 18:08:16 +08:00
ldm0 2f87fca606 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-03 18:08:16 +08:00
ldm0 75e62dded0 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-03 18:08:16 +08:00
ldm0 709295fe65 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-03 18:08:16 +08:00
ldm0 0553d1b9a7 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-03 18:08:16 +08:00
ldm0 e3f5a96cea 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-03 18:08:16 +08:00
ldm0 d62534d67b 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-03 18:08:16 +08:00
ldm0 7993418ed7 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-03 18:08:16 +08:00
ldm0 5cf15ece1e 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-03 18:08:16 +08:00
ldm0 30daa1f1c1 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-03 18:08:16 +08:00
ldm0 1574299af4 fix(media): honor codec color requirements in capability queries
Parse VP9 and AV1 color descriptions in the native MIME module, including BT.709 defaults and unspecified CICP fields. Report unsupported for mismatched or malformed descriptions while preserving derived dictionary conversion and snapshots.

Cover codec grammar and 1,144 query combinations, including matching configurations that must retain their existing support.
2026-11-03 18:08:16 +08:00
ldm0 34f56f3381 test(fetch): settle initial document before preload interception
Wait for the exact initial renderer Document load before enabling Page lifecycle events. This prevents a delayed fixture load from appearing among the next navigation request-pause events while retaining strict ordering assertions.
2026-11-03 18:08:16 +08:00
ldm0 b47498b39f test(animation): preserve native metadata in scan regression 2026-11-03 18:08:16 +08:00
ldm0 7de561b5b2 test(cdp): adapt captured navigation bodies to Base64 2026-11-03 18:08:16 +08:00
ldm0 f8d3d356d4 fix(media): derive capability configuration snapshots 2026-11-03 18:08:16 +08:00
ldm0 28c81a8b7c fix(css): use native font size adjustment shorthand semantics 2026-11-03 18:08:16 +08:00
ldm0 6dfac31b6a fix(css): preserve supports query token semantics 2026-11-03 18:08:16 +08:00
ldm0 a9b155dc22 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-03 18:08:16 +08:00
ldm0 3adf481236 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-03 18:08:16 +08:00
ldm0 6d4c186d57 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-03 18:08:16 +08:00
ldm0 fd96953b0f 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-03 18:08:16 +08:00
ldm0 6ee6ae020a fix(webrtc): back event dictionaries with native snapshots
Freezing an ICE or data-channel event must not freeze its mutable Event state. Move all three RTC event constructors onto the shared private backing and wrapper path, preventing initEvent from trying to redefine frozen public properties.

Derive argument arity, inherited EventInit conversion and interface validation, then initialize payload slots from the same dictionary schema. Preserve native payload identity, nullable URLs and original exceptions. Cover frozen dispatch and registered native Proxy payloads without admitting author or revoked Proxies.
2026-11-03 18:08:16 +08:00
ldm0 2b8617a48b 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-03 18:08:16 +08:00
ldm0 2a53c99f61 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-03 18:08:16 +08:00
ldm0 ecf52639f9 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-03 18:08:15 +08:00
ldm0 be6a90f58b 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-03 18:08:15 +08:00
ldm0 909058caea fix(paint): align canvas sources with modular paint internals
Adapt Canvas clip, Path2D and SVG rendering to the modular paint and scene types. Construct operation-only validation metrics through their owning module.
2026-11-03 18:08:15 +08:00
ldm0 fd5764a7f4 fix(fetch): preserve browser transport semantics across main updates
Adapt shared request bodies, redirect handling and per-transfer response progress to the updated fetch APIs. Keep decoding correct with the new curl build, including encoded-byte accounting, cache timing and dictionary readability.

Vendor curl-sys at the existing curl-rust revision to retain tested browser TLS EOF handling without downgrading main. Keep native body teardown test consumers with the updated helper and isolate the full compressed timing matrix by scenario.
2026-11-03 18:08:15 +08:00
ldm0 4fdbbbf1b7 fix(navigation): preserve Blob MIME and committed child state 2026-11-03 18:08:15 +08:00
ldm0 70ce0665d0 fix(navigation): resolve response MIME before document commit
Classify a bounded response prefix before replacing the active Document. Replay original chunks exactly once through the shared raw-document pipeline, retaining raw headers separately from computed MIME. Apply the same decision to streaming, captured and complete child responses.

Keep the old owner running while MIME is undecided. Cancel provisional navigation on stopLoading, propagate transport errors and route unsupported content to downloads before reporting navigation success. Allocate streaming-response navigation state lazily.

Add 13 native regressions for split signatures, replay and observer ownership, cancellation, old-document liveness, inert text, computed metadata and binary text downloads. Make the existing NUL literal-text fixture explicitly nosniff, preserving its assertions, and separately cover browser-confirmed binary download behavior.

Validation: fmt; all-target/all-feature workspace clippy; 22634 nextest passes with 32 threads and zero retries; original WPT 245/251 retained plus 3/3 added coverage. Pinned Chromium controls verify 12 MIME cases and 38 commit phases, 32 navigation cases, 36 frame metadata cases and 5 binary text/nosniff cases. No new original-WPT passes are claimed. Response-stage MIME overrides, image document.open DOM and Blob child-origin gaps remain follow-up work.
2026-11-03 18:08:15 +08:00
ldm0 4f7b773eca fix(documents): carry native MIME through frame snapshots
Publish native Document content types in page state and live, cached and detached child frame snapshots. Use this metadata for both CDP frame trees instead of raw headers or a hardcoded HTML type, without invoking author getters or creating child realms. Preserve raw response headers and HTML defaults for old serialized snapshots.

Expand native capture coverage for forged getters and disagreeing raw headers. Chromium controls verify document.open, lazy frames, cross-origin and sandbox metadata.

Validation: fmt; all-target/all-feature workspace clippy; 22621 nextest passes; original WPT 245/251 retained; frame metadata 33/36 (+13) and 12/12 (+11). Unknown main-response MIME sniffing remains follow-up work.
2026-11-03 18:08:15 +08:00
ldm0 e917f80cf2 fix(images): decode raster data served with XML MIME
Use the native raster probe to determine image usability even when MIME computation preserves a supplied XML type. Keep SVG decoder selection and existing response security and origin-clean checks.

Extend descriptor regressions across MIME, nosniff, HTTP status, origin-clean and invalid-data cases. Both original Fetch nosniff XML-MIME image tests now pass, with no new failures.

Validation: fmt; all-target/all-feature workspace clippy; 22621 nextest passes; original WPT 245/251 (+2); Chromium HTTP/Canvas/security matrix 18/18.
2026-11-03 18:08:15 +08:00
ldm0 475b699384 fix(documents): keep untyped nosniff navigations as text
Resolve missing or invalid navigation MIME with nosniff as text/plain before parsing, while preserving supplied MIME and image-subresource sniffing. Share the policy across streaming main documents and child navigation responses, Document network events and both main-frame tree paths.

Use only HTTP tab or space when recognizing the nosniff token, retaining VT and FF as significant bytes. This fixes three original classic-script WPT failures and avoids misclassifying navigation responses. Chromium comparisons fix eleven navigation scenarios, retaining all previous passes.

Validation: cargo fmt --all; all-target/all-feature workspace clippy; 22621 nextest passes, 16 existing skips; original WPT 243/251 (+3) with no new failures.
2026-11-03 18:08:15 +08:00
ldm0 85f67db9a6 fix(documents): stream native image navigation responses
Keep declared image response bytes out of HTML decoding and bind the browser-created host to its exact native image request. Complete the response through Document-owned post-parse work after DOMContentLoaded, retaining early navigation replies, source mutations, CSP checks and replacement cancellation.

Validation: fmt, all-target/all-feature clippy, 22617 nextest passes; original popup image WPT now passes, all 22615 prior native passes retained.
2026-11-03 18:08:15 +08:00
ldm0 b8411b93ba fix(documents): initialize child image documents from navigation bytes
Keep finite navigation text and image bodies as distinct sources. Build an
inert browser-owned image host and bind the accepted navigation bytes into the
existing image identity, decode and load lifecycle, avoiding a second request.
Keep later src mutations and author-created same-URL images subject to CSP.

Resolve absent HTTP MIME metadata through the shared byte sniffer instead of
the URL extension. Preserve explicitly supplied metadata, XML/SVG parsing and
native Blob image navigation. Cover source inertness, real image resources,
policy boundaries and the missing-MIME regression.
2026-11-03 18:08:15 +08:00
ldm0 9cd8c08f9c feat(images): support SVG decode with native receiver semantics
Reuse the existing image decode request and microtask pipeline for SVG images.
Validate HTML and SVG receivers through generated native brands and convert
binding failures to rejected Promises in the callee realm. Keep successful
decode Promises and EncodingError values in the backing receiver relevant realm,
including registered native proxies and images adopted across documents.

Cover href precedence and cancellation, cross-realm network settlement, forged
and proxy receivers, intrinsic constructor replacement, and native proxy realms.
Exercise the existing owner/relevant-realm assertions using real adoption.
2026-11-03 18:08:15 +08:00
ldm0 0400083809 fix(images): respect decode request ownership and microtask ordering
Reject decode for failed current image requests even while another element
is fetching the same key. Preserve in-flight reuse while the requesting
element is selecting its source, then observe its own bound request.

Keep mutation/load callbacks behind the invocation microtask. Cover CSP,
source insertion, cached and in-flight picture reuse, and independently
successful or failed same-URL requests with native regression matrices.
2026-11-03 18:08:15 +08:00
ldm0 c0268ca020 fix(images): target picture mutations by the affected element
Keep img insertion local, update every picture image for source tree changes,
and restrict source attribute mutations to following images. Include source
width/height in relevant mutations. Share the pending-request retention path
for attribute and tree changes to avoid duplicate fetches and decode rejection.

Validation: fmt; workspace all-target/all-feature clippy with -D warnings;
22603 native tests pass at 32 threads with zero retries; 37 picture HTTP
contracts pass. The unmodified image WPT cohort improves 119 to 120/122:
two fixed cases and one newly failing stale source-removal expectation. The
current HTML removal steps and Chromium both update all sibling images;
the old WPT failure remains visible in the validation report.
2026-11-03 18:08:15 +08:00
ldm0 22cb766f1c fix(images): retain referrer policies through request dispatch
Compare HTML image referrerpolicy states through the shared attribute planner.
Capture element and owner Document policies for network and Service Worker
requests, preserving that snapshot through interception and authentication.
Replay redirect referrer state before auth retries so stripped data stays lost.

Validation: fmt; workspace all-target/all-feature clippy with -D warnings;
22598 native tests pass at 32 threads with zero retries. Original image
mutation WPT improves 107/122 to 119/122; 39 strict HTTP/CDP/SW contracts
match Chromium, retaining the original image and HTTP hint regressions.
2026-11-03 18:08:15 +08:00
ldm0 71e80ccb08 feat(images): decode BMP through the shared raster contract
Admit BMP metadata and pixels using the existing bounded image decoder.
Preserve row orientation and padding, palette pixels, and malformed-input
rejection; support image loads and Canvas/ImageBitmap pixel consumers.

Validation: fmt, workspace all-target/all-feature clippy with -D warnings;
22595 native tests pass at 32 threads with zero retries; nine BMP pixel
contracts match Chromium; image/network regression cohorts retained.
2026-11-03 18:08:15 +08:00
ldm0 afe04237c9 fix(images): update requests for same-value attribute assignments
Run the shared image mutation plan for successful attribute assignments
even when the stored value is unchanged. Cover reflected properties,
UTF-16 setters, namespace setters, Attr mutations, and NamedNodeMap.

Keep a current in-flight request when the selected image identity is
unchanged, preserving decode promises and avoiding duplicate fetches.
Leave unrelated attributes and equivalent CORS states without image work.
2026-11-03 18:08:15 +08:00
ldm0 856fdd2d22 fix(images): synchronize completion with admitted image requests
Reuse accepted image data synchronously while keeping load delivery on
the native DOM task source. Derive completion from the active request
instead of an old resource slot.

Decode only the element's admitted resource and reject an already failed
request without waiting for error dispatch. Preserve request ownership,
Promise realms, and loaded resources after document base URL changes.
2026-11-03 18:08:15 +08:00
ldm0 de528c992b fix(images): load valid images from HTTP error responses
Use MIME and image bytes to determine decode eligibility instead of
requiring an HTTP 2xx status. Keep upstream request security checks and
origin cleanliness unchanged.

Cover valid raster and SVG bodies at error statuses and rejection of
empty or malformed image data through the shared parkable image path.
2026-11-03 18:08:15 +08:00
ldm0 ea4ed12f29 feat(fetch): honor subresource response Link preloads
Apply no-referrer to hints from final subresource responses and route them through their loading Document's resource authority. Reuse the native preload pipeline for network and Service Worker responses, deduplicate recursive hints, and reject retired owners before entering V8.

Preserve streaming bytes, cancellation and source security checks; exclude main-resource navigation and Worker-internal responses. Respect nosniff before ORB body sniffing.
2026-11-03 18:08:15 +08:00
ldm0 ca1e61eedc feat(fetch): preload stylesheets from Document response headers 2026-11-03 18:08:15 +08:00
ldm0 848fe49d60 fix(fetch): tolerate empty Link header parameters 2026-11-03 18:08:15 +08:00
ldm0 d2e576f908 feat(modules): preload modules from Document response Link headers 2026-11-03 18:08:15 +08:00
ldm0 0545508620 feat(fetch): preload scripts from Document response Link headers
Parse response hints once and load script preloads through the owning
Document resource authority, including CSP, interception, Service Workers,
integrity, cancellation and Resource Timing. Preserve script URL fragments
and prevent Service Worker producers from consuming their own preload.

Validation: cargo fmt, workspace clippy with all targets and features,
and all 22548 nextest tests passed with 32 threads and zero retries.
Original WPT nonce coverage now passes both cases; the existing header
modulepreload timeout remains a separate Modulator follow-up.
2026-11-03 18:08:15 +08:00
ldm0 b83f88c01f fix(fetch): load document dictionary hints in the owning storage partition 2026-11-03 18:08:15 +08:00
ldm0 1852dbfbe5 feat(fetch): support partitioned compression dictionaries 2026-11-03 18:08:15 +08:00