Commit Graph
192 Commits
Author SHA1 Message Date
ldm0 91a4480b8a fix(protocol): retain navigation ownership during response body reads
Keep request identity and cancellation in Fetch while read tasks exclusively own response data. Match completions to the registered read instead of reinserting transfers or replying to navigations from I/O completion.

Retire superseded reads immediately, drain reads on Fetch disable, and preserve typed read errors. Cover delayed successes, failures, request reuse, cancellation, and debugger-paused supersession.
2026-09-29 02:50:43 +08:00
ldm0 b406d462a5 test(network): activate blocked URL policy in parser script fixture
Enable Network before setting blocked URLs so the parser script is intercepted instead of depending on an external DNS or request failure. Wait through the scheduler and assert the exact script request fails with ERR_BLOCKED_BY_CLIENT while subsequent parsing continues.

An earlier full-suite run exposed the timeout. Validation after the fix: 20 exact-test stress iterations and three iterations of the 20-test blocked_urls module, all passing with flaky results treated as failures; cargo fmt --all; full workspace all-target all-feature Clippy with -D warnings; cargo nextest run --no-fail-fast (18833 passed, 16 skipped).
2026-09-29 02:36:54 +08:00
ldm0 3289d5b4c3 fix(scheduler): let replacement navigation pass load-blocked work
Centralize navigation dependency decisions for readiness probing and snapshot draining. Replacement actions can reach the owner that cancels the pending request even when earlier observations wait for that load, while exact owner authorization remains mandatory.

Keep retirement admission policy beside publication ownership. Extend coverage for stale owners, cancellation, reused frontend ids, duplicate terminals, and late results without reviving retired notifications or remote objects. The new queue regression fails before the scheduler fix.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast (18833 passed, 16 skipped on the final change set).
2026-09-29 02:36:54 +08:00
ldm0 255238328f fix(protocol): retire superseded intercepted navigations
Only the current navigation can suspend renderer output; older jobs retain cleanup ownership without blocking the active document.

Retire target-owned request, auth and response interceptions on supersession, cancel streaming transports and reject stale body-read completion. Cover paused debuggers, overlapping navigations, target isolation and once-only terminal replies.
2026-09-28 20:11:15 +08:00
ldm0 94ac141e7c refactor(protocol): simplify renderer navigation state 2026-09-28 20:11:15 +08:00
ldm0 efe54b5fa7 fix(navigation): preserve typed cancellation causes 2026-09-28 20:11:15 +08:00
ldm0 f0a82869f0 refactor(protocol): claim navigation work before reserving pages 2026-09-28 20:11:15 +08:00
ldm0 c4d0cac89a refactor(renderer): own document replacement debugger lifecycle
Move old-document debugger termination into renderer preparation scopes instead of tracking protocol navigation IDs in DevTools. Reject superseded response jobs using exact navigation tokens and cancellation authority, and retire their renderer-channel suspension independently.

Cover response interception and supersession while paused, repeated pauses, and prepare commit/cancellation/drop cleanup. Verified cargo fmt --all, workspace all-targets all-features clippy with warnings denied, 18444 nextest tests, and 20 stress iterations of 127 focused tests.
2026-09-28 20:11:15 +08:00
ldm0 79ea1406fa fix(devtools): unblock navigation while the debugger is paused
Track provisional loads by navigation ID on the existing renderer target and explicitly finish debugger policy on commit or cancellation. Return the pause-loop exit reason and terminate paused old-document execution through V8 Inspector.

Defer intercepted-response document creation until continuation, removing the eager prepared-document paths. Preserve committed documents for aborted navigations and cover repeated pauses, multiple sessions, interception and supersession.

Validated cargo fmt --all, strict workspace clippy, and cargo nextest run --no-fail-fast: 18,429 passed, 13 skipped. New regressions also passed 20 stress iterations and three confirmed debugger-paused ippure navigation probes.
2026-09-28 20:11:15 +08:00
ldm0 bec8ccf87d Split runtime fetch tests by scenario 2026-09-28 18:40:05 +08:00
ldm0 b050a31e96 Split background staging tests by concern 2026-09-28 18:40:05 +08:00
ldm0 2dc8e22741 Split DOM protocol handling by command phase 2026-09-28 12:27:20 +08:00
ldm0 6a3859fc18 Split worker target projection by worker kind 2026-09-28 12:27:20 +08:00
ldm0 e19590cbbf Split Runtime evaluate tests by behavior 2026-09-28 12:27:20 +08:00
ldm0 a47b30ae5e test(protocol): split Page navigation tests 2026-09-28 00:14:19 +08:00
ldm0 8bfd5aca16 refactor(protocol): split Page domain responsibilities 2026-09-28 00:14:19 +08:00
ldm0 c92e8c60bc refactor(protocol): split runtime evaluation modules 2026-09-28 00:14:19 +08:00
ldm0 c82dfce9bd test(protocol): split connection dispatch tests 2026-09-28 00:14:19 +08:00
ldm0 b414c927a4 refactor(protocol): split runtime dispatcher responsibilities 2026-09-27 17:04:40 +08:00
ldm0 bf3ed110f7 fix(cdp): preserve correlated command responses after page replacement 2026-09-27 03:10:54 +08:00
ldm0 2510929533 fix(cdp): derive page metrics from initialized layout 2026-09-27 01:43:26 +08:00
ldm0 ddbf52a668 feat(layout): initialize shared geometry on first demand 2026-09-27 01:43:26 +08:00
ldm0 5357eb6229 fix(screenshot): keep viewport fallback in page metrics
Restore zero DOM dimensions before layout publication. Keep the viewport
fallback in Page.getLayoutMetrics so clients can construct a positive clip
without changing element geometry or screenshot command semantics.

Empty clips remain invalid regardless of layout publication state. CLI
screenshot_full continues to request FullDocument directly on its first capture.

Cover cold and published clip rejection, page-metric captures with DPR and
scale, and CLI full-document output without a preceding viewport capture.
Document and test the separate cold Playwright fullPage limitation.
2026-09-27 01:43:26 +08:00
ldm0 e8f3272499 test(cdp): await child load before runImmediately isolation probe
Install the navigation through the target owner and wait for the child frame load event before registering the preload. This keeps delayed child initialization from replaying a new-document script during the top-level isolation assertion.
2026-09-26 19:14:15 +08:00
ldm0 47dde09e3e fix(cdp): expose viewport metrics before layout publication
Read live viewport and document scroll state for Page.getLayoutMetrics without forcing layout. Use published content bounds when available and the viewport otherwise.

Cover first Playwright viewport and clipped screenshots without CDP prewarming, and remove screenshot prewarming from DPR/resize and concurrent-page smoke cases. Keep element geometry and input dependent on explicit layout publication.
2026-09-26 19:14:15 +08:00
ldm0 ff782ab21a fix(navigation): admit renderer navigation that supersedes a pending load 2026-09-26 06:00:11 +08:00
ldm0 4b24590ce6 fix(layout): isolate PDF print layout from interactive snapshots 2026-09-25 10:19:22 +08:00
ldm0 179241dedd refactor(layout): publish layout only through explicit visual output
Make geometry, input and observers read the latest published layout without
cold-start or invalidation-triggered layout. Only screenshot, screencast and
PDF output can build and publish a new tree.

Connect WebDriver page screenshots to the shared output pipeline, explain how
to initialize layout in errors, and migrate fixtures to explicit publication.
Remove obsolete read policies and embedded-frame completeness metadata.
2026-09-25 10:19:22 +08:00
ldm0 2812a1de67 fix(input): consume existing snapshots for coordinate mouse input
Reject mouse input without a rendered snapshot and retain published geometry
across interaction invalidation. Mouse hit testing and native default actions
consume that snapshot without triggering layout; explicit geometry queries
and WebDriver click preparation may still demand layout.

Share geometry query dispatch and result conversion across demand and snapshot
reads, and cover cold input errors, DOM and hover changes, native defaults,
document replacement, and explicit snapshot refreshes.
2026-09-25 10:19:22 +08:00
ldm0 663a5501d7 fix(history): preserve each queued History API traversal
Coalescing consecutive History API requests discarded intermediate
same-document traversals and their events when joint traversal plans
entered the shared queue. Keep these requests in order and derive the next
index from the last queued step, while retaining Navigation API promise
reuse.

Apply top-level traversals to the page's default Window when an isolated
realm initiated the request. Add local back/forward coverage across same-
and cross-document entries, and verify every event and microtask turn in
the existing history tests and fixture.

Fixes: f8f46bf48 (fix(history): coordinate complete joint traversal plans)
2026-09-25 03:03:07 +08:00
ldm0 cb59961aa7 test(input): cover text control compatibility regressions 2026-09-25 03:03:07 +08:00
ldm0 3b24fb44f7 refactor(history): unify traversal coordination and native admission state 2026-09-25 01:55:51 +08:00
ldm0 987b09ca13 fix(history): isolate traversal info to initiating navigation 2026-09-24 02:39:25 +08:00
ldm0 7e40b17284 refactor(history): extract pure session history state machine 2026-09-24 02:39:25 +08:00
ldm0 f8f46bf488 fix(history): coordinate complete joint traversal plans 2026-09-24 02:39:25 +08:00
ldm0 1933cec74f refactor(input): centralize editing and native element clicks 2026-09-23 23:06:17 +08:00
ldm0 f0a31d85ed fix(input): dispatch InputEvent metadata for text edits
Dispatch trusted beforeinput and input events with operation-specific
inputType and data for text controls and contenteditable editing. Keep
beforeinput cancelable and report input.data after text normalization
and maxlength truncation.

Cover keyboard and CDP insertion, cancellation, deletion, and textarea
line breaks with 57 regression scenarios.
2026-09-23 23:06:17 +08:00
lanyue-llk 7bf36c9823 fix(input): preserve activation and navigation boundaries 2026-09-23 23:06:17 +08:00
ldm0 1418e3aa35 refactor(history): centralize joint session history state
Per-Window length counters cannot shrink after traversal and branching, and
leave retained sibling History objects stale. Give each traversable one
ordered history and cursor with stable step, browsing context, and Document
identities. All History getters read that state; Navigation entries remain
Document views.

Route push, replace, traversal, and pruning through the shared model. Carry
browser positions or renderer snapshots into new Documents and publish
committed mutations through the Page owner-action FIFO. Remove cached length
adjustments and DOM-order traversal guesses. Preserve srcdoc identity when
only its parent's URL changes.

Keep reset callback pushes in both renderer and browser history, and prune
discarded sibling Navigation entries when forward steps are removed.

Validation: cargo fmt --all; workspace all-targets/all-features Clippy with
warnings denied; cargo nextest run --no-fail-fast (18,501 passed, 14 skipped);
12 targeted Chromium/Moli state and length comparisons; frontend differential
1,020/1,020 matches, all 5,259 observed frames matching, with zero retries.
2026-09-23 20:39:06 +08:00
ldm0 f013d6db75 fix(history): preserve browser session length across child pushes
Seed newly committed renderer documents with the browser-owned session-history
length before author scripts run. Keep navigation, reload, and traversal from
losing prior entries that the Navigation API does not expose.

Grow joint history by newly appended entries, preserving existing parent steps
when a child pushes history and avoiding an extra step when replacing forward
history after back. Add protocol and renderer regression coverage.
2026-09-23 20:39:06 +08:00
ldm0 6d08975a69 refactor(fetch): preserve response header bytes end to end
Carry raw response header values through fetch, caches, redirects,
renderer delivery, workers, and protocol records. Convert explicitly
at WebIDL and protocol text boundaries while preserving opaque bytes.

Keep legacy CacheStorage and service worker metadata readable, and
advance the HTTP cache format for raw header values.

Validation:
- cargo fmt --all
- cargo clippy --workspace --all-targets --all-features -- -D warnings
- cargo nextest run --no-fail-fast
2026-09-23 02:02:54 +08:00
lanyue-llk bcf420f622 revert: undo split PR 640 merges (#734-#740) 2026-09-22 20:02:07 +08:00
mini llk cba79021aa fix(document): parse text responses with consistent decoding (#740)
* fix(parser): preserve text document MIME and encoding semantics

* fix(document): share literal text parsing across child document paths

* fix(document): construct projection parser with the public API
2026-09-22 19:50:42 +08:00
mini llk 011e2268f2 fix(navigation): cancel loading without retiring the active document (#738) 2026-09-22 19:49:18 +08:00
mini llk 1be735d5c5 fix(network): preserve request metadata and response evidence (#737) 2026-09-22 19:45:58 +08:00
mini llk 50a4242b2e fix(input): preserve activation and navigation boundaries (#736) 2026-09-22 19:45:14 +08:00
mini llk c5ac254058 fix(layout): refresh geometry and preserve inline fragments (#735) 2026-09-22 19:42:55 +08:00
ldm0 52fd1d0953 feat(protocol): expose resource runtime storage diagnostics
Expose the canonical resource runtime snapshot alongside the existing runtime id and memory-cache fields. Add a CDP regression that verifies disk-pool allocation and parked-image memory accounting.
2026-09-21 16:47:19 +08:00
ldm0 29283fd86a fix(network): scope CDP header overrides and preserve BiDi byte values
Restore original headers on redirect while preserving current-hop overrides
for authentication retries and keeping Network event identity intact.

Preserve raw BiDi Cookie, Set-Cookie, and extra header values through page,
navigation, and worker policies. Apply CDP's last-value behavior for duplicate
request header names.

Add coverage for header bytes, redirects, authentication, and event sequences.
2026-09-21 05:37:28 +08:00
ldm0 932a7225ac refactor(network): preserve request header bytes across interception
Carry RequestHeaders through navigation, Fetch/XHR, workers, redirects and auth,
with explicit Unicode and ByteString conversions at protocol and WebIDL boundaries.
Share the raw curl header list with WebSocket transport and decode binary response
headers without UTF-8 replacement. Keep header memory charging concrete.

Cover opaque values, UTF-8 overrides, duplicates, redirect/auth continuation and
WebSocket handshakes with byte-level regression tests.
2026-09-21 03:54:12 +08:00