Commit Graph
5036 Commits
Author SHA1 Message Date
ldm0 4a16a92848 fix(runtime): adapt retained WPT surfaces to native main APIs
Use native Document ownership, mutation plans, event outcomes and resource APIs. Remove duplicate declarations and obsolete adapters while retaining the existing behavior coverage.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast. Checks cover the integrated workspace with 32-way concurrency and no automatic retries.
2026-11-20 22:47:58 +08:00
ldm0 6b760c7d88 style: format workspace after main integration
Apply the workspace formatter to retained code after rebasing main.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast. Checks cover the integrated workspace with 32-way concurrency and no automatic retries.
2026-11-20 22:47:58 +08:00
ldm0 3b96d14dd3 fix(websocket): validate receivers with native brands
Use generated receiver validation for WebSocket methods, attributes, and event handlers. Resolve registered native Proxies to their shared state while preserving unbranded internal WebSocketStream records.

Declare the standard prototype toStringTag data property and reject missing send arguments before checking connection state. Cover cross-realm TypeError identity, author wrappers, and canonical native-Proxy event handlers.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast (24,043 passed, 18 existing skips; 32 threads, no retries).
2026-11-20 22:47:58 +08:00
ldm0 a9c53f155d fix(websocket): downgrade early HTTP/2 negotiation failures 2026-11-20 22:47:58 +08:00
ldm0 18e66f220b feat(websocket): support native HTTP/2 extended CONNECT
Negotiate RFC 8441 after the peer advertises ENABLE_CONNECT_PROTOCOL, preserve
the CONNECT_ONLY stream through handshake completion, and reuse the native
WebSocket frame codec with bounded HTTP/2 receive and send flow control.

Translate native poll interests for WINDOW_UPDATE/TLS progress, reject writes
after stream reset, and retire unsupported H2 connections before the existing
HTTP/1.1 negotiation fallback. Keep TLS, proxy, DNS, owner and queue policies.
Correct the mixed-transport fixture to advertise each listener's protocol.

Validation: cargo fmt --all; strict workspace/all-targets/all-features clippy;
cargo nextest run --no-fail-fast (24036 passed, 18 existing skips). All 24031
previous passing test IDs retained; five new native/handshake regressions.
2026-11-20 22:47:58 +08:00
ldm0 5117be3008 fix(fetch): align HTTP/1 status prefixes with Chromium
Extend the existing private browser response-header adapter to locate
case-insensitive HTTP within four leading non-NUL bytes, including
newlines and fragmented reads. Preserve the native fast path, reject
five-byte and NUL prefixes, and charge removed bytes to the header limit.

Keep protocol detection and normalization in one shim and retain the
upstream-source replacement guards. Cover all three Fetch transports,
binary bodies, and informational responses without changing existing
tests or request deadlines.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets
--all-features -- -D warnings; cargo nextest run --no-fail-fast
(24031 passed, 18 existing skipped, 32 jobs/threads, zero retries).
2026-11-20 22:47:58 +08:00
ldm0 b93068b116 fix(fetch): check idle connections before reuse
Backport curl 774d3bff38515beb75c6d86c3e0455f0c8da7c9e so pending
input on an idle connection is checked even within the one-second
health-check window. Delayed bytes after a completed 304 response must
not become the status line of the next XHR request.

Cover buffered, HTML-streaming and raw-streaming Fetch requests with a
barrier-controlled regression. Keep the existing valid keep-alive reuse
test unchanged.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets
--all-features -- -D warnings; cargo nextest run --no-fail-fast
(24029 passed, 18 existing skipped, 32 jobs/threads, zero retries).
2026-11-20 22:47:58 +08:00
ldm0 1277584edd fix(runtime): resolve bound owners without V8 property lookups
Resolve Window hosts and Worker state through the existing Context owner binding. Failed stream-transfer cleanup then preserves pending exceptions and avoids author bridge getters. Keep weak ownership and the pre-binding bootstrap fallback.
2026-11-20 22:47:58 +08:00
ldm0 6122c27f70 fix(streams): serialize transfer chunks as port messages 2026-11-20 22:47:58 +08:00
ldm0 c4e97d3684 fix(streams): report transfer deserialization errors to peers 2026-11-20 22:47:58 +08:00
ldm0 0159e38fbe fix(messaging): prepare Window transfers before target checks 2026-11-20 22:47:58 +08:00
ldm0 65a7a52d05 test(xhr): gate timeout-before-upload controls with preflight
The first-report timeout controls assumed that an 80ms busy task would
finish before the network service's 100ms reporting interval. Scheduler
preemption can invalidate that assumption; fixed Chromium 152 also emits
upload completion before the delayed XHR timeout when that happens.

Hold a CORS preflight on a second loopback origin for the two controls
that require no upload report. No body can be transmitted while the
preflight is pending, regardless of task overrun. Preserve every event
assertion and all 16 cases in both Window and Worker, including the normal
network's positive completion/reporting cases. Abort both owned servers
when the CLI run ends.

Independent normal and 160ms-overrun controls match Chromium and the
published-parent debug/release binaries on all 24 cases; each profile
observes six held preflights and zero POST requests to the held endpoint.
2026-11-20 22:47:58 +08:00
ldm0 9147537cd5 fix(timers): clamp nested Window and worker callbacks
Track nesting per target execution context and apply the 4ms minimum after six callbacks. Retain the level through microtasks to match Chromium, restore it before asynchronous follow-up, and keep browser algorithm timeouts independent. Cover interval, function, source, microtask, reset and exception paths; make the existing stream termination fixture wait for real timer deadlines.
2026-11-20 22:47:58 +08:00
ldm0 72dfd35242 fix(runtime): finish parser script cleanup after engine termination 2026-11-20 22:47:58 +08:00
ldm0 dead4b1585 fix(dom): share scoped registries across native owners 2026-11-20 22:47:58 +08:00
ldm0 90084d0c3f fix(dom): preserve registry data on realm retirement 2026-11-20 22:47:58 +08:00
ldm0 fbb5bb02f0 refactor(dom): separate registry data from native element state 2026-11-20 22:47:58 +08:00
ldm0 51201789f6 perf(dom): reuse document registry resolution during serialization 2026-11-20 22:47:58 +08:00
ldm0 875ff7f870 perf(dom): keep owner-qualified registry associations compact 2026-11-20 22:47:58 +08:00
ldm0 396cac47b4 perf(dom): skip irrelevant frame and SVG mutation walks 2026-11-20 22:47:58 +08:00
ldm0 bd146fc4cf fix(dom): qualify custom element registry keys by native owner 2026-11-20 22:47:58 +08:00
ldm0 64959a1c73 fix(dom): resolve registries through their native receiver owner 2026-11-20 22:47:58 +08:00
ldm0 5e5a9a26ca perf(dom): discover shadow-tree frames through candidate index
Use the existing shadow-including containment and tree-order helpers to find
frame owners directly, rather than scanning every retained shadow host.
Keep disconnected queries structural because compaction may drop candidates.

Restore shadow-frame candidates during the existing reconnection walk.
Cover ordering, reinsertion, clone/import/adoption, inert template contents
and foreign elements.
2026-11-20 22:47:58 +08:00
ldm0 823422d4ba fix(dom): initialize parser shadow registries incrementally
Carry newly created null and document-default registry associations through
parser handoffs instead of cloning every retained ShadowRoot after each parse.
Keep fragment, streaming, windowless and popup consumers on the same path.

Preserve the registry when attachShadow reuses a declarative root. Cover
stream notification ownership and cross-document default/null associations
with a fixture also exercised against native Chromium.
2026-11-20 22:47:58 +08:00
ldm0 e83cfbf303 test(fonts): drive resource completions and rejection notifications
Retain local font completion queues and explicitly dispatch resource bodies and font tasks. Use the Page owner executor for Promise rejection notifications, preserving intermediate loading states and the original assertions.
2026-11-20 22:47:58 +08:00
ldm0 72dbce9a08 fix(indexeddb): complete native key and upgrade handle integration
Create requests after key conversion and reject transactions invalidated by author code. Preserve transaction-owned wrapper identities across borrowed methods and keep the stronger key-range regression coverage.
2026-11-20 22:47:58 +08:00
ldm0 55c9a85804 fix(dom): derive getHTML options and shadow root sequences 2026-11-20 22:47:57 +08:00
ldm0 3e09d80cfd fix(dom): derive slot assignment option dictionaries
Share AssignedNodesOptions through WebIdlDictionary/WebIdlArgs for
assignedNodes and assignedElements. Reject primitive dictionaries, propagate
member getter exceptions and ignore unknown flattened spelling.

Resolve the node runtime after option conversion so getter mutations and
reentrant assignment queries see current state without retaining a Rust
runtime reference across user JavaScript. Keep the generated receiver check.

Cover default/member conversions, getter/proxy/receiver ordering, callee
TypeError realms and reentrant mutations in live and windowless documents.

Validation: full Rust gates, 23,787 passed/18 skipped. Normal debug/release
CLIs each match Chromium152 on all192 native controls and all3 fixtures;
the pinned old binary differs in112 controls. All178 original observations
were retained per profile; the176 fully observed non-getHTML pages retain
all2398 prior passing IDs. Native getHTML timeout/cleanup failures remain
open and also reproduce with old debug/release binaries under load; no
whole-profile compatibility or performance non-regression claim.
2026-11-20 22:47:57 +08:00
ldm0 31b404dbf9 fix(fetch): reconcile APIs after main rebase
Use the unified origin-scoped transport authentication helper in the imported
proxy credential regression. Include the existing default Accept-Encoding in
the new complete cookie-header assertion.

Remove obsolete renderer JSON parser aliases after XHR switched to intrinsic
parsing, and initialize response cache/preload metadata in the imported
streaming JSON BOM regression.

Validation: cargo fmt --all; workspace/all-target/all-feature clippy with
-D warnings; full nextest, 23,787 passed and 18 skipped, with zero retries.
2026-11-20 22:47:57 +08:00
ldm0 4627845f1c fix(events): clear non-node related targets after shadow dispatch
Clear native relatedTarget together with a shadow-scoped target even when
the related target has no DOM node handle, such as an XHR or Window. Keep
the initial dispatch path across listener mutations and bypass author
getters through the existing private Event state.

Cover four event interfaces, four non-Node target kinds, both shadow modes,
path mutation, composed dispatch, ordinary Event shape, and poisoned getters.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets
--all-features -- -D warnings; cargo nextest run --no-fail-fast.
23,727 passed, 18 skipped; 32 build jobs/test threads, zero retries.
2026-11-20 22:47:57 +08:00
ldm0 4742d07b71 fix(xhr): order browser upload reports before delayed timeouts
Use acknowledged upload reports in Window and Worker, and preserve Chromium's empty-versus-absent body event behavior. Select queued browser network notifications before delayed timers even with old V8 foreground work; retain the source FIFO, eight-turn fairness bound and ordinary foreground order.

Measure Worker XHR's first timeout deadline from send, preserve ordinary timer admission, and retire pending/ready cancellations after microtasks. Add scheduler regressions and the same 16-case Window/Worker HTML through the native CLI.

Validation: root fmt and strict workspace/all-target/all-feature Clippy; full nextest 23,723 passed / 18 existing skips, 32 threads, zero retries. Fresh normal CGU=1 release: 58/58 terminal and upload sequences match Chromium; exact CLI/CDP fixtures pass 16/16 per Window/Worker; separated 80ms/180ms controls match 12/12. Retained redirect, completed-response, selected-response and held-network regressions passed. Original XHR WPT: 139/140, four improvements and no regressions; remaining supplemental HTTPS fixture also fails in Chromium. Existing response-header and Worker keepalive differences remain documented.
2026-11-20 22:47:57 +08:00
ldm0 03c2e43c50 feat(fetch): add acknowledged browser upload reporting
Separate transport byte accounting from browser upload notifications. Poll on the existing curl owner with a 100ms cadence, coalesce reports until owner acknowledgement, and flush at final response headers/completion. Queued reports retain only weak observer identity; native immediate observers keep their existing behavior.

Cover held responses, acknowledgement backpressure, final-header flush, empty/absent bodies, early responses and cancellation with real TCP regressions.

Validation of the combined final tree: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast (23,723 passed, 18 existing skips, 32 threads, zero retries). Fresh normal CGU=1 release and independent CLI/CDP regressions passed.
2026-11-20 22:47:57 +08:00
ldm0 7e22ddb480 fix(fetch): admit redirects through the live script owner
Wait asynchronously for Window/Worker XHR and Fetch owners before following each redirect, keeping unrelated resource I/O runnable and cancellation wakeable. Preserve Window keepalive and synchronous XHR paths, and cover buffered, streamed, headers-first and resumed requests. Reuse the existing Worker XHR timeout flow when a queued redirect observes an elapsed current timeout; leave ordinary Worker timers unchanged.

Add an HTTP CLI regression covering Window and a persistent Worker, independent I/O, keepalive, request modes, timeout changes, abort and synchronous XHR.

Validation: cargo fmt --all; strict workspace/all-targets/all-features Clippy; cargo nextest run --no-fail-fast (23716 passed,18 existing skips,32 threads,zero retries). Normal CGU1 release compared with Chromium152; original WPT, completed-response arbitration and held-network controls retained.

Original XHR WPT:112 observations/140 IDs,135 pass/5 fail;one historical status flip retained and reproduced with the unchanged b104 release (HTTP/HTTPS),while Chromium152 passes both. Existing Worker keepalive-after-retirement differences remain documented.
2026-11-20 22:47:57 +08:00
ldm0 d8e528a20f fix(xhr): preserve completed responses when delayed timeouts fire
A Window or reused Worker's timeout task can run before its queued networking delivery after a long JavaScript task. Arbitrate timeout cancellation against the selected transport response through the existing resource lease, preserving completed outcomes while continuing to cancel pending requests. Keep authentication and response-interception holds timeout-able, and leave explicit abort/open cancellation unchanged.

Add a production CLI regression covering Window/Worker responses, timeout changes, incomplete bodies, author abort and request reuse.

Validation: cargo fmt --all; strict workspace/all-targets/all-features Clippy; cargo nextest run --no-fail-fast (23715 passed,18 existing skips,32 threads,zero retries). Normal CGU1 release:20 core cases and10/12 additional cases match Chromium152;2 pre-existing redirect differences retained;6 held-network cases match;112 original WPT observations/140 IDs with no new regressions.
2026-11-20 22:47:57 +08:00
ldm0 5660830ada fix(xhr): exclude native network waits from JS watchdog budgets
Long synchronous XHR can exhaust the script watchdog while no author JavaScript is running. Pause the active owner-thread registrations only around the response/timeout/cancellation channel wait, then restore the remaining budgets before processing results or entering callbacks.

Use new deadline keys after resuming so stale queued expiries cannot terminate a resumed registration. Handle nested waits, disarmed registrations and already exhausted budgets without adding service threads. Keep the default eight-second JS budget and the XHR-specific timeout/cancellation paths.

Cover real HTTP waiting, post-wait runaway JavaScript, nested waits, stale expiries, disarm and recovery.

Validation on the combined source tree: cargo fmt --all; strict workspace/all-targets/all-features Clippy; cargo nextest run --no-fail-fast (23714 passed, 18 existing skips, 32 threads, zero automatic retries).
2026-11-20 22:47:57 +08:00
ldm0 64159e312e test(media): bound video fixture waits per native operation
The fixture combines loading, bitmap snapshots and two native seeks under one 2.5-second case timer. Give each ready, seek and bitmap operation its own 2.5-second bound and include the operation and elapsed time in failure diagnostics. Preserve all 192 distinct pixel, frame, realm and ownership checks and the scenario driver's overall bound.

Validation on the combined source tree: cargo fmt --all; strict workspace/all-targets/all-features Clippy; cargo nextest run --no-fail-fast (23714 passed, 18 existing skips, 32 threads, zero automatic retries).
2026-11-20 22:47:57 +08:00
ldm0 b35d51f7af test(forms): run multipart encoding through Page navigation tasks
The inherited regression inspects a child navigation immediately after form.submit(), while this branch schedules form navigation on the Page task executor. Use the existing executor fixture and consume the FormNavigation task before inspecting the request. Preserve both charset cases and every byte-level assertion.

Validation on the combined source tree: cargo fmt --all; strict workspace/all-targets/all-features Clippy; cargo nextest run --no-fail-fast (23714 passed, 18 existing skips, 32 threads, zero automatic retries).
2026-11-20 22:47:57 +08:00
ldm0 e71c8fb58c fix(network): keep resource I/O runnable during JavaScript tasks
Own native resource coordination at the browser-context resource owner root,
shared across Fetch backend generations. Page and Worker authorities borrow
that executor; shutdown cancels its tasks and joins it without giving request
futures ownership of the runtime. Route Worker XHR through its captured runner.

Admit pre-scanned scripts with request policies only after their Document owner
installs those policies. Preserve runners when UA/config changes replace and
retire an old Fetch backend. Cover background progress, shutdown, backend
replacement, and production Window/Worker callback ordering.

Validation: cargo fmt --all; strict workspace/all-targets/all-features clippy;
cargo nextest run --no-fail-fast (23,709 passed, 18 existing skips; 32 jobs/test
threads, zero retries); normal release CGU=1; 286 original WPT page observations.
Window HTTP/HTTPS long-task timeout tests now pass; all 884 WebTransport test
statuses are unchanged. Existing 5ms upload-order and synchronous long-request
failures, including raw status regressions, remain recorded in docs/inner.
2026-11-20 22:47:57 +08:00
ldm0 0693bcc056 fix(webtransport): preserve HTTP/3 CONNECT session semantics
Accept successful CONNECT statuses and legacy-profile optional protocol metadata. Distinguish clean CONNECT FIN from malformed or interrupted capsules, retain immutable diagnostics and SDK unwind safety, and cover the behavior with real QUIC regression tests.
2026-11-20 22:47:57 +08:00
ldm0 7d5cb8b469 fix(webtransport): deliver stream termination to JavaScript
Notify idle Window and worker streams through weak endpoint identities, preserving realm-correct error identity. Connect the existing controller AbortSignal algorithms to native cancellation.

Deliver pending bytes before FIN and acknowledge BYOB EOF through the shared Streams source completion helper.
2026-11-20 22:47:57 +08:00
ldm0 7954822a8c feat(webtransport): drive cancellable native stream I/O
Observe peer termination without application demand and interrupt blocked writes or FIN acknowledgement through a bounded native driver.

Backport Quinn terminal-reader waker cleanup and preserve unmappable reset failures. Add real QUIC regressions for cancellation, FIN, invalid codes, and passive observer lifetime.
2026-11-20 22:47:57 +08:00
ldm0 a943e7a0a9 feat(webtransport): connect native Window and worker streams 2026-11-20 22:47:57 +08:00
ldm0 ead9ec338a feat(webtransport): authenticate pinned server certificates 2026-11-20 22:47:57 +08:00
ldm0 32cadf92c4 feat(webtransport): add browser-owned native HTTP3 sessions
Add QUIC byte streams, datagrams, protocol negotiation and graceful close with browser DNS/TLS/address policy. Bind the connector to the Fetch semantic owner and retain independent per-session cancellation.

Include real peer lifetime tests and a Fetch connector probe validated against upstream WPT HTTP/3 handlers. JavaScript frontend integration remains separate.
2026-11-20 22:47:57 +08:00
ldm0 405a83fac4 fix(worker): forward console logs through native Inspector
Forward original Worker console arguments to the captured V8 console so CDP
preserves UTF-16 code units, native object handles and Inspector replay.
Share Window's stack-hook protection and retain CLI/classic log capture.

Remove synthetic Worker Runtime console replay and its obsolete cursor.
Reuse per-session native Console ownership to avoid duplicate notifications,
and route ServiceWorker Console commands through the existing native adapter.

Cover all Worker global kinds, replay/disable/discard, author hook isolation,
raw protocol ownership and real page/Worker replay isolation.
2026-11-20 22:47:57 +08:00
ldm0 ef5541d3e8 fix(inspector): retain native UTF-16 routing and binding errors
Reuse the native InspectorJson transport and schema-specific handle ownership. Preserve independent frontend IDs/session routing, bounded raw wire output, pause balance and automation sidecars with complete additional regressions.

Decode binding error text strictly for the scalar consumer while preserving its original error code and avoiding success state updates. Keep opaque Inspector payloads unchanged.
2026-11-20 22:47:57 +08:00
ldm0 7fce094ee3 fix(xhr): dispose state when Window contexts retire
Canceling transports and queued tasks left XHR send flags and cached response
state live. A parent microtask could still abort a removed iframe's XHR and
receive terminal events, or inspect old response data after context retirement.

Register weak per-realm lifecycle observers and dispose live instances at the
captured LocalWindow retirement boundary, before caller microtasks. Preserve
readyState, clear response/send state, and suppress automatic XHR/upload events.
Keep deferred realm teardown idempotent and preserve same-Window document.open.

Cover immediate state snapshots across removal/navigation/document.open, weak
GC ownership, and real partial HTTP response cancellation before VM cleanup.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets
--all-features -- -D warnings; cargo nextest run --no-fail-fast.
1440 focused and 23623 full tests passed; 18 skipped, 32 threads, 0 retries.
2026-11-20 22:47:57 +08:00
ldm0 a4e5a59391 fix(xhr): cancel Window requests when reopening
Terminate the previous Window fetch only after open() validates its arguments.
Share transport retirement with abort() while retaining each method's own state
and event transitions, and resolve the network host from the XHR receiver realm.

Cover actual TCP cancellation before headers and during a partial response,
replacement completion, invalid-open preservation, and interception retirement.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets
--all-features -- -D warnings; cargo nextest run --no-fail-fast.
2026-11-20 22:47:57 +08:00
ldm0 21e69e1bd4 test(workers): tolerate pre-request cancellation in timing fixture
An immediately aborted fetch can close an accepted socket before sending an
HTTP request. The request reader returns an empty string for that EOF; avoid
parsing it as a request line and panicking the fixture server.

Keep the resource timing assertions and actual-request abort checks intact.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets
--all-features -- -D warnings; cargo nextest run --no-fail-fast.
2026-11-20 22:47:57 +08:00
ldm0 1e8ab406c3 fix(xhr): deliver local responses on networking tasks
Queue local responses and failures after the initiating task's microtasks.
Use the XHR's creation context so borrowed methods retain the receiver's
Window lifetime and completion realm. Preserve generation/abort checks and
synchronous delivery.

Cover microtask cancellation, late completion, borrowed methods and iframe
retirement. Migrate existing local-response fixtures to actual task/event
completion, including the CDP failure and preserved document.open wrapper
checks. Align CSP/loadend and batch marker ordering with pinned Chromium
observations while preserving response and state assertions.

Validation: fmt; strict workspace/all-target/all-feature clippy;1348 focused
checks; full nextest23618 passed,18 skipped,zero retries.
2026-11-20 22:47:57 +08:00