Commit Graph
4120 Commits
Author SHA1 Message Date
ldm0 2d8b3496fa feat(fetch): stream author request bodies from Window and workers
Read author streams through internal read steps on their script owner and
feed the bounded HTTP/2 transport with snapshotted Uint8Array chunks. Carry
backpressure through owner queues and preserve AbortSignal cancellation
reasons while mapping source failures to network errors.

Wait for upload transmission before processing early responses, preserve
uploads after redirect headers, and reject authentication replays only for
supported challenges within the credentials mode. Keep local URL responses
independent of HTTP upload consumption.

Cover wire delivery before EOF, binary views, backpressure, early redirects,
authentication, source failures, abort identity and local Window/Worker
responses. All required workspace checks pass: 25,087 tests passed and
19 skipped. The 68 original H2 upload subtests pass in ordinary debug and
release builds, up from 40, with no prior PASS lost.
2026-11-03 18:08:21 +08:00
ldm0 0c258f566a fix(fetch): reject streaming redirects before rewriting requests
Check non-replayable source identity before POST-to-GET rewriting and route same-origin author streams through the shared redirect policy. Preserve 303, manual/error, missing Location, and byte-backed replay behavior. Cover raw and materialized transfers with a real HTTP matrix.
2026-11-03 18:08:21 +08:00
ldm0 3e2aabd081 fix(curl): synchronize shared peer and credential references
Protect counts shared by detached easy handles and cached connections with curl platform locks. Decide the last release under the same lock without holding it across allocation, destruction, or callbacks.
2026-11-03 18:08:21 +08:00
ldm0 3d1d97cbc5 feat(fetch): add native HTTP/2 streaming uploads
Add a single-use request body with bounded backpressure, cancellation and
upload-transmission completion independent of response EOF. Resume paused
reads on curl's owner and support buffered, HTML and raw response transports.

Require HTTPS with HTTP/2, prevent 421 replay, and preserve uploads after
early responses. Honor KEEP_SENDING_ON_ERROR in curl's HTTP/2 END_STREAM
handling so early 4xx responses do not reset an unfinished upload.

Cover channel ownership and backpressure plus real H2 progress, EOF,
cancellation, early responses, warm HTTP/1 rejection and non-replayability.
This provides the native transport for later Window/Worker stream wiring.
2026-11-03 18:08:21 +08:00
ldm0 e68f443513 fix(fetch): preserve header name casing on network dispatch
Retain the first accepted header spelling in the internal list and combine
request values for native dispatch without using the lowercase public
Headers projection. Preserve case through append/set, Request copies and
clones; reset it after delete. Keep lookup and Set-Cookie case-insensitive,
and retain lowercase public iteration and explicit HeadersInit conversion.
Use a one-pass name index when rebuilding the stored list. Canonicalize
CORS exposed-name metadata separately when materializing a response.

Exercise Window and Worker through twelve real HTTP requests each,
covering duplicate values, public views, mutations, internal copies,
author-overridden iterators and generic iterable initializers.

Validation: cargo fmt --all; workspace all-target/all-feature clippy with
-D warnings; full nextest (25,064 passed, 19 skipped), 32 threads, no retries.
2026-11-03 18:08:21 +08:00
ldm0 558d64150a fix(fetch): retry replayable 421 requests on a fresh connection
Intercept one misdirected response before publishing its headers or body,
then resend the same logical request on a new connection. Preserve the
upload bytes, cancellation, original hop deadline and redirect metadata.
Do not apply the discarded response's cookies or replay author streams.
Carry the request body's source state through Window, Worker and Service
Worker network dispatch, and reset the retry budget on redirects.

Exercise the three native transports with two idle pooled connections,
a truncated 421 body, repeated 421s, byte-exact uploads, non-replayable
sources, cancellation, deadlines and a redirect between retry budgets.

Validation: cargo fmt --all; workspace all-target/all-feature clippy with
-D warnings; full nextest (25,062 passed, 19 skipped), 32 threads, no retries.
2026-11-03 18:08:21 +08:00
ldm0 29f3b2b5e2 fix(fetch): reject aborted response consumption before reading
Distinguish a fetch abort from an ordinary native network-body failure.
After receiver and unusable-body checks, reject an already-aborted body
immediately without locking or disturbing its stream. Preserve the exact
abort reason and failure kind across response clones in Window and Worker.
Ordinary stream errors retain their existing consumption/task semantics.

Cover all six Body methods, repeated calls, clones before and after abort,
primitive and object reasons, lock precedence, author-created stream
wrappers, and real Service Worker-intercepted responses.

Validation: cargo fmt --all; workspace all-target/all-feature clippy with
-D warnings; full nextest (25,055 passed, 19 skipped), 32 threads, no retries.
2026-11-03 18:08:21 +08:00
ldm0 a4039fe066 fix(fetch): preserve raw Location bytes when resolving redirects
Escape non-ASCII Location bytes before URL parsing, matching Chromium's
HTTP redirect handling. Reuse the same encoder for native transports,
manual CORS redirects, and Service Worker synthetic redirects, while
retaining ordinary HTTP fields' isomorphic ByteString representation.

Exercise valid UTF-8, invalid octets and existing percent escapes on the
wire through buffered, HTML and raw transports. Cover browser redirects
and extend the synthetic Service Worker redirect regression.

Validation: cargo fmt --all; workspace all-target/all-feature clippy with
-D warnings; full nextest (25,053 passed, 19 skipped), 32 threads, no retries.
2026-11-03 18:08:21 +08:00
ldm0 7af7aad98f fix(fetch): enforce client mixed-content policy before network dispatch
Capture native Window and Worker HTTPS state independently of SecureContext,
author base URLs and request referrers. Preserve the request policy through
Service Worker fallback and intercepted request reconstruction, and validate
initial requests before preflight/cache use and redirects before connecting.

Retain Chromium's loopback exemption and default SharedWorker behavior.
Cover native client ownership, empty referrers, preflight/response cache reuse,
and downgrade redirects with regression tests.

Validation: cargo fmt --all; workspace all-target/all-feature clippy with
-D warnings; full nextest, 32 threads, no retries, default stack.
2026-11-03 18:08:21 +08:00
ldm0 ecdf506e05 fix(navigation): preserve reload and history request provenance
Capture the native child navigation kind when queueing Location reloads or
history traversals, retain it across document bootstrap, and project it to
Service Worker Request navigation flags. Preserve the same kind when
rebuilding intercepted network requests and navigation preload requests.

Cover native Request copies, clones and RequestInit resets for each kind.
Add a real HTTP regression proving that Service Worker navigation fallback
retains reload cache validation without applying it to history traversals.

Validation: cargo fmt --all; all-target/all-feature workspace clippy with
-D warnings; full nextest (25,046 passed, 19 skipped), 32 threads, no retries.
2026-11-03 18:08:21 +08:00
ldm0 7cb127c7b6 fix(fetch): reset inherited navigation state for defined RequestInit members
Use converted dictionary member presence without rereading JS getters.
Preserve native navigation flags for empty initialization, and reset them,
navigate mode and referrer metadata before applying defined overrides.
Retain null BodyInit presence without treating it as a replacement body.

Cover all supported reset-triggering members, absent/undefined members,
null body and signal, single getter evaluation, cache-mode validation order
and source Request isolation through the native constructor binding.

Validation: cargo fmt --all; all-target/all-feature workspace clippy with
-D warnings; full nextest (25,044 passed, 19 skipped), 32 threads, no retries.
2026-11-03 18:08:21 +08:00
ldm0 c900668cd0 fix(fetch): reuse eligible same-origin memory cache responses
Apply force-cache and only-if-cached stale reuse after representation and
Vary selection. Give cors and same-origin requests the same raw response
identity only for untainted same-origin URLs, retaining origin, credential,
partition, cookie and redirect-handling boundaries. Current consumers still
validate every cached redirect and response before exposing it.

Add four I/O regression tests for stale reuse, Vary and authority isolation,
cached same-origin redirects and denial of cached cross-origin redirects.
Validation: workspace fmt, all-target/all-feature clippy, and full nextest
(25,043 passed; 19 skipped).
2026-11-03 18:08:21 +08:00
ldm0 dda4c52234 fix(fetch): honor request HTTP cache modes
Preserve all six cache policies through Window and worker Fetch using a
shared derived enum. Emit cache request controls without replacing author
fields, bypass storage for default conditional requests, and reuse eligible
stale entries for force-cache and only-if-cached. Cache-only misses produce
a typed network error before connecting while retaining Vary, partition,
cancellation and redirect security checks.

Exercise wire headers, stale reuse, conditional requests, cache replacement,
cache-only misses, privacy boundaries and cached redirects with seven native
I/O regression tests. Validated with workspace fmt, all-target/all-feature
clippy and the complete nextest suite (25,039 passed; 19 skipped).
2026-11-03 18:08:21 +08:00
ldm0 b8ab4dce01 test(worker): await nested keepalive detachment before inspection
Joining a parent Worker intentionally does not synchronously join its nested
Workers. Wait for the child to publish its pending detached keepalive before
asserting its exact count, while withholding the server response. Keep the
existing timeout and the zero-after-completion assertion.

Validation: workspace fmt, all-target/all-feature clippy and full nextest.
2026-11-03 18:08:21 +08:00
ldm0 b909029f57 fix(canvas): preserve binding order after main rebase
Keep path bindings ahead of rectangle bindings while retaining main's
derived clearRect receiver and numeric conversions. Preserve the existing
prototype property installation order.
2026-11-03 18:08:21 +08:00
ldm0 c1e24dd988 fix(fetch): normalize body Blob types without MIME serialization
Keep the combined Content-Type spelling while applying Blob ASCII type
normalization, matching Chromium. Preserve case-sensitive MIME parsing for
formData and cover native headers, pending streams, and body bytes.
2026-11-03 18:08:21 +08:00
ldm0 0c3b96dd28 fix(fetch): enforce CORP before delivering network responses 2026-11-03 18:08:21 +08:00
ldm0 6be2a01079 fix(workers): enforce creator embedder policy during startup 2026-11-03 18:08:21 +08:00
ldm0 37417b10e1 fix(cache): enforce opaque response policies on cache reads 2026-11-03 18:08:20 +08:00
ldm0 67dbd081d4 fix(reporting): expose native Report snapshots with toJSON 2026-11-03 18:08:20 +08:00
ldm0 98e44ba413 feat(fetch): preserve response credentials state 2026-11-03 18:08:20 +08:00
ldm0 a44dbe36ce perf(dom): avoid empty custom-element registry removal plans 2026-11-03 18:08:20 +08:00
ldm0 ca369d70d9 fix(dom): enforce native Window agent-cluster boundaries 2026-11-03 18:08:20 +08:00
ldm0 099607527e fix(dom): ignore domain relaxation in isolated agent clusters
Use native Window agent-cluster isolation independently of the
permissions-filtered crossOriginIsolated capability. Keep domain
validation and conversion errors, and avoid recording ignored
assignments or refreshing their Window security tokens.
2026-11-03 18:08:20 +08:00
ldm0 4ec9471894 test(xhr): synchronize upload timeout microtasks with real reports 2026-11-03 18:08:20 +08:00
ldm0 7dcf66eb23 fix(storage): reconcile WPT state with SQLite partitions 2026-11-03 18:08:20 +08:00
ldm0 a167bbeb6b fix(fetch): honor Document credentialless network policy 2026-11-03 18:08:20 +08:00
ldm0 67713e4d42 fix(fetch): omit credentialless worker network credentials 2026-11-03 18:08:20 +08:00
ldm0 deacb9a9af fix(runtime): gate SharedArrayBuffer constructors on native isolation
Use V8 per-context constructor policy and conditional installation after binding the native Window or Worker owner. Keep the intrinsic and Wasm shared memory available without exposing the global in nonisolated realms.

Preserve shared BufferSource regression coverage through Wasm-derived constructors and check Window, Worker, iframe, ServiceWorker, SharedWorker, and unbound V8 Context exposure.

Validation: cargo fmt --all; strict workspace/all-target/all-feature clippy; cargo nextest run --no-fail-fast (24,925 passed, 19 skipped; 32 jobs, zero retries).
2026-11-03 18:08:20 +08:00
ldm0 9c5c93be79 fix(runtime): finish native context adaptation after main rebase
Use the native Worker Context binding for Trusted Types after removal of the private carrier. Follow the renamed Window bootstrap and initialize runtime-only Document environments explicitly.

Adapt the transaction GC regression to the store-name lifecycle argument and remove the obsolete whole-matrix timeout helper after main split cursor probes into bounded sections. Format the merged native context exports.
2026-11-03 18:08:20 +08:00
ldm0 98be105306 fix(workers): distinguish service and shared worker isolation
Derive ServiceWorker isolation from its own trustworthy enforced COEP response.
A COEP-only worker can clone shared memory; a DIP-only response cannot grant
this capability.

Keep SharedWorker agents in the default non-isolated mode, including the Blob
creator-policy fallback, while retaining independent COEP/DIP network policies.
Cover actual classic/module registration, HTTP and Blob creation, and cloning.
2026-11-03 18:08:20 +08:00
ldm0 c51cd34214 fix(isolation): honor permissions and inherit iframe capabilities
Apply response and container cross-origin-isolated permissions before allowing
structured-clone shared backing stores, preserving denials across descendants.

Resolve COEP-only child capabilities from the top-level COOP+COEP group while
keeping DIP isolation local and compatible with Chromium. Preserve the policy
in navigation snapshots and worker request contexts.
2026-11-03 18:08:20 +08:00
ldm0 eb786f7237 feat(structured-clone): clone isolated shared memory across agents
Retain native V8 backing stores and validate native isolation and agent-cluster identity before creating receiver wrappers. Carry creator identity through pending, local and nested DedicatedWorker creation while keeping storage and transfer-list rejection. Cover graph aliases, growable buffers, Wasm memory, worker/port forwarding and native authority boundaries against default Chromium.
2026-11-03 18:08:20 +08:00
ldm0 377cc109f4 fix(workers): retire nested workers with their parent global
Keep nested Worker handles in their parent global's native registry so terminate and global retirement release descendants through the existing nonblocking shutdown path. Remove production raw handle ownership from V8 private slots.

Add classic and module worker regressions for ancestor termination, self.close and explicit child termination while preserving an unrelated live worker's lock.
2026-11-03 18:08:20 +08:00
ldm0 b157a31c9b fix(cdp): update prepared document policy before commit publication
Route restricted network policy updates through the registered pending Page and renderer agent before its Document token reaches protocol. Recheck the native agent and existing Document identity across action flushes before acknowledging the update.

Add a deterministic unpublished-commit regression and verify that a different agent cannot mutate native settings.
2026-11-03 18:08:20 +08:00
ldm0 bd921fa7b2 fix(fetch): preserve metadata gates after main rebase
Route untagged script resource requests through the shared per-destination
Fetch Metadata helper. Cover all four script resource kinds in the existing
trustworthiness and buffered/HTML/raw redirect matrices.

Remove duplicate cache-timing module registration and response cache-state
initialization introduced while replaying history onto main.

The extended policy test fails on the old fallback. Root fmt, strict
workspace/all-target/all-feature clippy and full nextest pass afterwards:
24,880 passed, 18 skipped, 32 threads, zero automatic retries.
2026-11-03 18:08:20 +08:00
ldm0 8d2a07f737 fix(runtime): finish iframe load callbacks before late descendants
Keep owner-element load and pageshow runnable when a load callback starts
a descendant navigation. Continue waiting for that descendant at FrameFinish
so ancestor Documents retain their load dependencies.

Cover six callback and descendant scenarios with a shared fixture and a
fixed default Chromium 152 oracle, and retain exact owner/phase assertions.

Validated with root fmt, strict workspace/all-target/all-feature clippy,
and full nextest: 24,870 passed, 18 skipped, 32 threads, zero automatic retries.
2026-11-03 18:08:20 +08:00
ldm0 cda6fc5a36 test(runtime): deduplicate referrer regression after main rebase
Keep one copy of the worker referrer network test, retaining its complete
assertions. Format the upstream Document referrer fixture after integrating
both independent fixture suites.

Validated with root cargo fmt, all-target/all-feature clippy, and full
nextest: 24,869 passed, 18 skipped, 32 threads, zero automatic retries.
2026-11-03 18:08:20 +08:00
ldm0 14a4d54356 test(runtime): preserve module registrations after main rebase
Keep the existing Gamepad registration and the new Geometry constructor
regression when replaying module moves onto main. Avoid registering the
moved Gamepad module a second time.
2026-11-03 18:08:20 +08:00
ldm0 e4a092aa3f fix(blob): partition child navigation and isolate cross-site popups
Authorize captured child Blob resources with the initiating Document's full
storage key, and carry that admitted result through navigation and history.
Denied resources commit an opaque error Document through the normal load
lifecycle instead of retrying an unscoped lookup or leaving load pending.

Apply Chromium's Blob-site versus top-level-site opener rule to newly
selected Window, anchor and area popups. Preserve existing named target
reuse, including its opener, as verified against Chromium.

Cover foreign and own child Blob URLs, same-site subdomain popup controls,
all three popup entries and existing named popup navigation.
2026-11-03 18:08:20 +08:00
ldm0 7bd993b9e6 fix(protocol): retain navigation until the initial Page is installed
Renderer output can publish a location change before protocol installs its
initial Page handle. Keep the immutable navigation with its existing build
completion, then revalidate the original Page residence before starting it.

Cover successful installation, failed builds and replaced Page reservations
through the production initial-document build path.
2026-11-03 18:08:20 +08:00
ldm0 c1d43a7ebd fix(runtime): finish native main integration
Register the Worker stream-clone regression module once after merging overlapping histories. Restore the established prepared-clone transfer-step layout to avoid unrelated code movement.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast (24858 passed, 18 existing skips).
2026-11-03 18:08:20 +08:00
ldm0 73e4d645ee fix(blob): retain resolved resources across object URL revocation 2026-11-03 18:08:20 +08:00
ldm0 c75d6cde0b fix(worker): enforce storage keys for blob main scripts
Authorize Blob URL entry snapshots with the creator browser partition and complete storage key before reading backing data. Apply the same check to Window and nested DedicatedWorker scripts and SharedWorker main-script loading.

Report denied Blob loads through the existing asynchronous worker failure tasks. Cover classic/module workers across a cross-site ancestor, nested workers, and rejection before lazy backing I/O.
2026-11-03 18:08:20 +08:00
ldm0 d14a4990cf fix(websocket): serialize opening handshakes by resolved endpoint
Queue native TCP candidates by their resolved endpoint until the opening handshake ends. Preserve alias matching, proxy target scope, complete DNS answers and cancellation while waking only actual waiters.

Validate TCP ordering, FIFO, cancellation, timeout, shutdown, independent destinations and owners, proxy routing, fallback addresses and IPv4-mapped IPv6. Keep the page/worker owner lifecycle fixture pending on distinct ports.
2026-11-03 18:08:20 +08:00
ldm0 f7e775c653 fix(indexeddb): derive durability options and preserve transaction hints 2026-11-03 18:08:20 +08:00
ldm0 6a802bcc03 fix(indexeddb): apply transaction durability to native WAL writes 2026-11-03 18:08:20 +08:00
ldm0 3621c9002a fix(indexeddb): route schema renames through native transactions
Expose store and index names through branded prototype accessors and lossless
WebIDL conversion. Admit existing SQLite rename commands before publishing
COW metadata, native transaction scope and canonical handle keys. Preserve
original handle identity for upgrade abort, including deleted/reused names.

Prepare cursor continuations with current native labels at API admission
while preceding commands keep their FIFO names. Cover persisted data and
generators, rollback, native Proxies, shadows and conversion reentry.

Restore the preserved Window/child/worker rename probes and schema-attribute
rename sections with measured Chromium committing and abort expectations.
2026-11-03 18:08:20 +08:00
ldm0 793bc1aa72 fix(indexeddb): release collected transaction state
Register transactions with the existing collectible-wrapper finalizer and
remove lifecycle entries during the deferred sweep. Unreachable terminal
wrappers no longer leave native scope names and lifecycle metadata behind.

Keep queues and task payloads as active owners. Cover retained getters and
snapshots, commit/abort cleanup, queued writes without author roots, and
committed data readback under forced V8 GC.
2026-11-03 18:08:20 +08:00
ldm0 2d07dff6b7 fix(indexeddb): enforce native transaction store scopes
Store accepted UTF-16 names in native transaction state and expose
objectStoreNames as fresh DOMStringList snapshots. Schema edits and
upgrade rollback no longer read or write author-owned scope properties.

Check terminal state and native scope before returning canonical store
handles. Preserve Chromium's committing rejection and existing request
activity checks. Reuse native proxy identity and callee-realm bindings.
2026-11-03 18:08:20 +08:00