Commit Graph
686 Commits
Author SHA1 Message Date
ldm0 83e7b01871 fix(navigation): release superseded adopted parser continuations
An adopted native replacement can be superseded before protocol installation.
Stale completion used to leave its response-gated parser held on the live Page,
so the next beforeunload never ran. Release that continuation only for the
original Page residence and adopted Document agent.

Add deterministic beforeunload and newer-Document retention tests.
2026-11-22 02:02:09 +08:00
ldm0 ee7d08e241 fix(navigation): retain live pages when replacement observers cancel
A newer navigation can cancel a replacement response while its Document is
already installed and still completing its requested lifecycle stage.
Detach that observer and continue on the existing Page, preserving its
navigation reply policy and original close owner.

Cover cancellation after the native Document is installed but before
protocol adoption, followed by beforeunload for the successor navigation.
2026-11-22 02:02:09 +08:00
ldm0 39d44abe37 fix(navigation): cancel popup requests before browser adoption
A synchronous popup.stop() could precede creation of its protocol target, so
its frozen window.open URL was still loaded later and replaced the initial
Document, aborting requests made after stop. Capture the Window cancellation
generation with the accepted popup action and revalidate it during projection.
Adopt the initial Page while discarding the revoked request and its resources.

Cover three sequential real image loads after stop and a later same-name
navigation, including zero requests for canceled URLs and one accepted request.
2026-11-22 02:02:09 +08:00
ldm0 9eceff1f51 fix(service-workers): wait for clients.claim to apply control
Settle claim promises only after the owning worker run has applied the
controller changes, and reject claims from inactive workers. Keep pending
claim resolvers alive and route replies by request id to that worker run.

Publish the activating worker as active before dispatching activate so
waitUntil(clients.claim()) can complete. Retire the previous active worker
and publish controller changes at this transition instead of deferring
the claim until activation finishes.

Queue functional events until activate finishes, including events received
while the worker is still bootstrapping, without changing their run owner
or counting them twice.

Deliver startup claim replies through the exact starting run, and publish
the worker handle before its parent message pump can process requests.
2026-11-22 02:02:08 +08:00
ldm0 edcd756328 fix(history): resolve fallback targets before beforeunload
A History API request can fall back to browser-owned entries that are absent
from the renderer's history view. Firing beforeunload before the browser
resolves the destination lets an out-of-range history.back() recursively
schedule more traversals and starve an in-flight Location navigation.

An unresolved fallback must also retain a pending Location request until
the browser selects a real traversal destination. Check the outgoing tree
only after selecting that destination.
Keep renderer-checked Location and known cross-document traversal requests
on their existing route. Cover back(), forward(), and go() with an owned
history-task regression that fails on the previous implementation. Also
cover a traversal queued by beforeunload while a Location is pending, and
replace the old test assertion that required discarding that request.
2026-11-22 02:02:08 +08:00
ldm0 68a805e83a 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-22 02:02:08 +08:00
ldm0 27938ac883 feat(fetch): preserve response credentials state 2026-11-22 02:02:08 +08:00
ldm0 8cf2a4c562 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-22 02:02:07 +08:00
ldm0 2f3e6f1d34 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-22 02:02:07 +08:00
ldm0 ab4a65cc6b fix(blob): retain resolved resources across object URL revocation 2026-11-22 02:02:07 +08:00
ldm0 d9533fe5dc fix(indexeddb): apply transaction durability to native WAL writes 2026-11-22 02:02:07 +08:00
ldm0 fd5c39153c fix(cdp): preserve navigation ownership and inspector response order
Forward lossless CDP wire messages through native ownership workflows. Preserve exact earlier console output before terminal replies, and let old Inspector commands receive context-destruction results before their response routes retire.

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-22 02:02:07 +08:00
ldm0 d1d1e78e33 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-22 02:02:06 +08:00
ldm0 143141fb68 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-22 02:02:06 +08:00
ldm0 14b2fbd213 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-22 02:02:06 +08:00
ldm0 a5d6b04ae5 fix(runtime): integrate main event dispatch and font ownership
Preserve shared listener registry identity across document.open, use explicit target/ancestor listener filters, and retain canonical EventTarget inheritance after the main rebase. Drive font and streamed-navigation tests through their native completion queues and align event-order expectations with pinned Chromium 152 observations.
2026-11-22 02:02:05 +08:00
ldm0 1ea666fbad fix(dom): dismiss removed child documents before retirement
Dispatch the existing child dismissal lifecycle on frame removal, matching Chromium so pagehide and unload can start native keepalive requests. Keep removal free of the cancellable beforeunload check.

Use the document unload claim for reentrant sibling retirement, and validate the outgoing Window identity before cancelling native navigation work so reattached successors keep loading. Cover real network delivery, retired callbacks, self-removal and sibling reinsertion.
2026-11-22 02:02:05 +08:00
ldm0 9f0f54532e fix(cors): cache validated preflight permissions in the browser runtime
Reuse successful method/header grants across Fetch and XHR clients without
bypassing actual response checks or fabricating OPTIONS network events.
Partition permissions by storage key, initiator, redirect-aware origin and
full URL; retain credential/wildcard rules, bounded expiry, cache controls,
failed-hop invalidation and explicit browser-cache clearing.

Cover cache boundaries with deterministic-clock regressions and native HTTP
checks across buffered/streaming clients and shared/isolated browser owners.
2026-11-22 02:02:05 +08:00
ldm0 faacadee13 fix(window): preserve active documents during popup close 2026-11-22 02:02:05 +08:00
ldm0 95d9239f5d fix(location): read Document locations from their Window
Resolve active Documents through their native Window association instead of a per-wrapper Location copy. Remove the duplicate cache and its bootstrap/navigation synchronization. Cover real popup parser/load phases, borrowed getters, and retired/windowless Documents.
2026-11-22 02:02:05 +08:00
ldm0 25f1b5b777 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-22 02:02:04 +08:00
ldm0 71ec4c4087 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-22 02:02:04 +08:00
ldm0 5f38806c6f 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-22 02:02:04 +08:00
ldm0 bd54f4320a fix(csp): carry initiator policies through local document navigation 2026-11-22 02:02:04 +08:00
ldm0 c1211fb81c fix(csp): snapshot meta policies for cross-realm Location navigation 2026-11-22 02:02:04 +08:00
ldm0 e326b41f3d 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-22 02:02:04 +08:00
ldm0 46402da5b0 test(cdp): adapt captured navigation bodies to Base64 2026-11-22 02:02:04 +08:00
ldm0 efe44e00e7 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-22 02:02:03 +08:00
ldm0 013e0f6186 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-22 02:02:03 +08:00
ldm0 eb2a184182 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-22 02:02:03 +08:00
ldm0 fb4a6537c3 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-22 02:02:03 +08:00
ldm0 61a777c0e3 fix(dom): destroy child navigables without unload events 2026-11-22 02:02:03 +08:00
ldm0 389928f77d fix(performance): expose native resource timing response metadata
Add the remaining response metadata and router getters with native JSON snapshots. Preserve request, interim and final header observations through Window and Worker fetch lifecycles, and filter iframe encoding metadata before discarding redirect provenance.

Validation: cargo fmt --all; strict workspace/all-target/all-feature Clippy; 22470 nextest PASS with 16 existing skips; 2114 retained original WPT PASS; 24/24 interim-response tests and 28/28 native metadata contract checks. Original WPT gained 106 PASS without losing existing PASS.
2026-11-22 02:02:02 +08:00
ldm0 04ef7df13d fix(dom): preserve windowless event policy and node ownership 2026-11-22 02:02:01 +08:00
ldm0 045a2638ab fix(events): preserve uncompiled handler source as native UTF-16 2026-11-22 02:02:01 +08:00
ldm0 95b9924f48 fix(window): preserve inherited opaque origin access across Pages 2026-11-22 02:02:01 +08:00
ldm0 6c29b0bf82 fix(dom): use native adoption for windowless Documents 2026-11-22 02:02:01 +08:00
ldm0 b48abe1447 test(page): preserve gated traversal responses after cancellation 2026-11-22 02:02:01 +08:00
ldm0 ef907d8b1e fix(runtime): integrate WPT fixes with current main
Route existing Window.open targets through native navigation without the
Location-specific before-load replacement rule. Run form event assertions
through queued submission tasks using fully loaded child Documents, and
retain target-realm FormData and request payload checks.

Reconcile the expanded FontFace and IndexedDB fixtures, restore the SVG
precision test registration, and adapt ignored-response assertions to the
NoDocument outcome while retaining response metadata checks.
2026-11-22 02:02:00 +08:00
ldm0 82f1b50671 test(navigation): await popup cancellation observers before snapshots
Observe cancellation through the four existing navigation Promise callbacks before capturing the closed popup state. Preserve late handler release and every lifecycle, Promise, and error-identity assertion, avoiding a fixed 100ms delay as proof that cancellation callbacks have settled.
2026-11-22 02:01:59 +08:00
ldm0 c4e4d6b36f fix(dom): resolve related Page wrappers through their producer host
Read host-local reflector IDs through the wrapper creation context, including DOMStringMap interceptors and borrowed methods. Create uncached wrappers in the producer realm when related default worlds share canonical identity. A native popup regression borrows opener getters and checks warm/cold dataset, classList and style identity, prototypes and writeback without mutating the opener.
2026-11-22 02:01:59 +08:00
ldm0 ee60b15cdb test(protocol): drive related Window fixtures through native Page scheduling
Run network navigation fixtures inside LocalSet with the background navigation scheduler. Attach popup inspector contexts to their owning CDP target and wait for actual asynchronous navigation responses. Preserve the original behavior assertions, request counts and timeouts; record frame state on timeout for diagnosis.
2026-11-22 02:01:59 +08:00
ldm0 c178aebd83 fix(renderer): reconcile native Window lifecycle with protocol Page ownership
Use the canonical Window.document and Location objects across related Pages, retain producer identity and inherited about-document settings, and preserve the Page dispatch policy for cross-document history traversal. Route stop and close through exact Document owner actions and apply them through ordered protocol target lanes. Keep unload reentry checks and bootstrap output ordering. Window.opener=null preserves its accessor as specified; adjust the two conflicting protocol expectations while keeping the renderer regression. Register the main realm owner before native HistoryEntry bootstrap so inherited origins remain in committed history; replace an initial-empty entry consistently in both navigate events and Location seeds. Empty URL reuse can retain a focus activation with navigation_requested=false while preserving every document/history/load assertion. The renderer enum producer and exhaustive protocol consumer change together. Formatting, strict workspace Clippy and the complete nextest suite passed against unchanged final source with 32 workers and zero retries.
2026-11-22 02:01:59 +08:00
ldm0 5f791a5da7 fix(webmcp): adapt form navigation lifecycle to current main 2026-11-22 02:01:58 +08:00
ldm0 b1741991a2 fix(input): release individual CDP touch contacts 2026-11-22 02:01:58 +08:00
ldm0 3ce4880d7b fix(input): preserve touch contacts across CDP updates 2026-11-22 02:01:58 +08:00
ldm0 3ad2470603 fix(dnd): enforce drag data store modes and event lifetime 2026-11-22 02:01:58 +08:00
ldm0 d0cf5ad835 fix(navigation): reconcile paused lifecycle after main rebase
Run tree beforeunload from the existing Inspector scope so navigation can
start its request while the old script remains paused. Bind the active
Page per owner-task poll and preserve the beforeunload output prefix and
navigation fence without completing a suspended Runtime command.

Keep document-replacement termination pauses internal while preserving
real output and balancing pauses already reported to frontend sessions.
Keep intentional pagehide/unload callbacks debuggable during replacement.
Cover root/child lifecycle ordering, 204 recovery, resumable unload,
multiple sessions and cancellation between pause notification and loop entry.
2026-11-22 02:01:56 +08:00
ldm0 b0706dbb19 fix(navigation): protect unload targets during descendant checks
Keep the navigation target protected from document.open/write/writeln while iframe and popup descendant beforeunload handlers run. Acquire the target counter after its reentry check so its own event still dispatches.

Cover target writes, guard release after the check, and writable intermediate documents with behavioral regressions.
2026-11-22 02:01:55 +08:00
ldm0 61549c3ee6 fix(navigation): check renderer history traversals before fetching 2026-11-22 02:01:55 +08:00