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.
Run browser-initiated main-document checks through the existing asynchronous
lifecycle scheduler before Fetch interception or network loading. Project the
source turn first, reject superseded navigation tokens, and share navigation
finalization so failed checks retain the committed document and release state.
Foreground DevTools callers remain pending through the check and load, preserving
typed navigation results and the captured target owner.
Keep beforeunload and commit unload commands out of nested non-V8 Page-agent
dispatch while the owner is debugger-paused. Cover real navigate/reload/history
responses, retained documents, pause/resume, supersession, and Fetch ordering.
Dispatch beforeunload across the source document tree before renderer navigation requests. Keep the source Location visible until commit and protect the navigation target from destructive writes in descendant callbacks. Cover lifecycle ordering, navigation reentry, removed descendants, source URL preservation and history policy snapshots.
Restore native History cursors from sparse serialized positions, preserve
shared Window history across isolated realms, and keep entry identity and
structured state through document.open and cross-realm settlement.
Move event subclass and precommit state access onto shared native backing.
Respect published iframe layout snapshots and align history, rendering,
and rejection tests with their owning task boundaries. Remove duplicate
upstream tests and obsolete helpers from the main rebase.
Validation: cargo fmt --all; workspace/all-targets/all-features Clippy with
-D warnings; full Nextest (20,319 passed, 16 skipped); fresh CLI HTTP/CDP
fetch resource timing fixture (36/36). Build and tests used 32-way parallelism.
Share a browsing-context budget across pushState, replaceState, go, back and
forward. Preserve argument conversion and mutation serialization/URL errors
before admission; refused calls do not cancel navigation or dispatch events.
Bound synchronous history update reentrancy across Windows and release the
admission guard on return. Retain child budgets across document navigation and
drop them when the browsing context is removed or closed. Cover recovery,
receiver ownership, conversion order, and recursive navigation callbacks.
Rescan the owning Document for autofocus after intercepted navigation, with
focus-without-user-activation policy and native trusted initiation preserved
through transient activation expiry. Track focus changes per Document so a
parent focus change does not cancel a child navigation reset.
Keep viewport focus ownership explicit and retain the sequential Tab starting
point across manual focus resets and blur. Add regression coverage for policy,
autofocus selection, trusted input, Tab order, and nested viewport transitions.
Gate cross-document navigate events on the initiator and current target origin-domain while preserving cross-origin fragment events. Route named-frame window.open and GET form fragments through native Location navigation to preserve cancellation, interception, and document/history identity.
Route existing hyperlink targets through native Window identity and the shared
navigation path. Preserve click involvement and sourceElement, suppress
cross-origin source exposure, and honor cancellation and interception in child
frames and named popups.
Retain popup referrer policy and synchronous fragment activation after the
navigate event accepts it. Add regression coverage for trusted and synthetic
clicks, ancestor targets, canceled navigation, interception, and popup policy.
Keep submit and formdata events synchronous while navigation runs as a
DOM-manipulation task. Capture the request, submitter, target and history
handling; coalesce replaced submissions without extra task turns.
Preserve popup POST requests, cross-origin and sandbox boundaries, and
javascript URL replacement ordering. Follow form navigation that starts
during document creation and cover reentrant, adopted and same-URL forms.
Validation: cargo fmt --all; workspace all-target/all-feature clippy with
warnings denied; cargo nextest run --no-fail-fast (20,002 passed, 16 skipped).
Two additional official WPT cases pass with no passing-case regressions
across the form and Navigation API suites.
Initialize the history field in the upstream navigation fixture. Use the existing 8 MiB stack helper for the two deep traversal tests whose replacement-navigation path exceeds the default test-thread stack.
Keep child entries and srcdoc resources with their parent Document identity
when top-level and popup Documents are replaced. Restore their original joint
history steps, avoid traversing descendants of a retiring parent, and prune
forward entries when navigation branches from an earlier step.
Preserve parser-created frame identities in navigation projections. Cover
named and unnamed frames, script-created parents, nested Documents, entry
state and identity, and interleaved multi-step traversals through CDP.
Carry committed renderer history through browser navigation requests and
restore structured state, entry identities, and activation before new
Document scripts execute. Read the latest committed source entries when
creating the destination so state updates made during a pending response
are retained.
Keep browser traversals aligned with native Document identities, rebuild
private history ordinals for restored top-level entries, and use native
entry indices for fragment mutations after a cross-origin history prefix.
Cover structured-state restoration, pending-navigation source updates,
fragment indices, browser-owned back/forward traversal, and same-Document
realm and element preservation after WebDriver history restoration.
Set the canceled flag when aborting a navigate event during dispatch, including iframe traversal events that are not author-cancelable. Preserve the flag when a precommit handler aborts the navigation after dispatch has ended.
Keep cross-document history traversal running when stop() cancels its Navigation API event and promises. Continue checking that its original Window and Document are active before queuing the load.
Cover detachment, window.stop(), and nested navigation in both phases, plus the non-cancelable preventDefault control. Verify abort listeners, promise rejection identity, the exception realm, and cross-document restoration.
Spec: https://html.spec.whatwg.org/multipage/nav-history-apis.html#abort-the-ongoing-navigation
Spec: https://html.spec.whatwg.org/multipage/document-lifecycle.html#stop-loading
Reject retained traversal results in their original realm when the target
LocalWindow retires before the history task runs. Complete the Promise
reactions without firing navigation events or applying stale history.
Keep PageVm namespaces and exact task ownership checks when consuming the
payload, and leave classic History tasks without results as no-op cleanup.
Choose back/forward destinations from the committed current entry so
repeated pending calls share the same destination and result Promises.
Cover removed and reinserted frames, same- and cross-document traversals,
rejection realms and callback completion, and PageVm task-ID reuse.
Keep child document subtrees active while a history response is pending or
ignored. Check beforeunload before navigate, then defer pagehide and unload
until a document response commits. Preserve the event flag independently
of temporary native unload counters so later navigations remain usable.
Unload removed frame subtrees before retiring their Window and Document
wrappers, and reject active navigation trackers before removal events.
Dispatch in the retiring realm so removing cross-origin frames does not
leak a SecurityError into the parent.
Cover delayed responses, 204/205/download retries, stop(), and detachment
with gated protocol tests.
Route popup history traversal through the Window-owned task queue and retain
its Navigation API signal and method results until commit or cancellation.
Window.stop() aborts those API results while the physical traversal continues.
Deliver popup pageshow and traversal unload events, preserve nested unload
guards, and handle close() from navigate and pagehide callbacks. Add gated
HTTP regression coverage for traversal metadata, cancellation, ignored
responses, and opener history isolation.
Start real loads for popup Navigation API calls and reloads. Keep the
active URL and history while fetching, then install the destination
history only when its response commits, including redirects.
Cancel pending resource loaders on stop or close, preserve pending
promises for ignored responses, and reject reentrant navigations during
stop callbacks. Add gated HTTP regression tests for these boundaries.
Notify Navigation API in the popup's exact execution scope before the close
task retires its callbacks and LocalWindow. Re-establish the popup alias
from its retained Window when its opener has already been detached.
Cover precommit and committed query, fragment, and reload interceptions,
late handler settlements, reentrant close/navigation, same-name popups,
and opener retirement while checking unrelated windows remain usable.
Resolve Window.stop() through the receiver's captured Window binding and
cancel intercepted fragment/reload navigations as well as descendant
frame navigations. Preserve cross-document traversal handling and guard
ancestor stops against reentrant abort listeners. Keep Window identity
valid across document.open() without targeting replacement LocalWindows.
Import the corrected upstream stop-before-commit WPT and cover receiver,
shadow-frame, history, promise, and callback reentrancy behavior.
Reject the navigation API method's committed and finished promises before
firing navigateerror, then reject the transition promises. Apply this order
to pending precommit rejection and cancellation for navigate/reload and
history traversal, including microtasks enqueued by abort/error listeners.
Retain the traversal committed resolver across author callbacks while
deferring its rejection until the API method promises have been rejected.
Add both unmodified upstream precommit-rejection ordering variants and a
39-scenario protocol regression covering method and native navigations,
child/popup owners, rejection identity, cancellation, history, and downloads.
Keep precommit controllers usable until interception commits and read the
final redirect URL, history mode, and state after all precommit handlers
settle. Resolve redirects against the owning document base URL, including
popup documents, and expose the redirected navigation type on the event.
Route intercepted Location, anchor, and form navigations through the shared
pending precommit transaction. Reject controllers from retired windows and
prevent canceled work from committing even when the old event is edited.
Add two unmodified upstream redirect WPT variants and protocol regressions
covering async redirects, multiple handlers, cancellation, history parity,
download suppression, child windows, and popup retirement.
Run intercepted download links through the shared same-document navigation
lifecycle, including precommit handlers, redirects, cancellation, history
commits and transition settlement. Suppress the download once intercepted
and preserve the source element identity in child and popup windows.
Allow shared settlement without Navigation API method promises, resolve
transition.committed with undefined and finish fulfilled handlers in their
existing reaction so navigatesuccess precedes author microtasks.
Cover download interception and transition return values with protocol
regressions, plus four unmodified upstream WPT query variants.
Settle the canceled event's transition promises with its AbortError. Retain the committed resolver before abort/error callbacks so a reentrant navigation cannot resolve the old transition, and preserve any replacement transition during cleanup.
Cover back(), navigate(), and reload() cancellation by stop(), a subsequent navigation, and a subsequent intercepted navigation, including promise reasons and renderer/CDP history consistency.
Carry transition resolvers through pending traversal commits and settlement,
reusing precommit transitions and the shared navigation lifecycle. Keep
committed reactions after currententrychange and intercept handlers, and
finish empty handler lists asynchronously.
Preserve rejection reasons and transitions started by completion callbacks.
Add default protocol regressions and four unmodified upstream WPT variants.
Serve their .mjs helper through the compat fixture server.
Intercepted Navigation API pushes and replacements use URL/history updates.
Skip popstate and hashchange in their shared commit path, including deferred
precommit handlers and destinations that would otherwise change documents.
Import upstream precommit push, replace, reload, and traversal tests, and
cover event suppression, handler failures, state, and CDP history together.
Synchronize Document.URL and report same-document pushes, replacements, and
traversals when their renderer entries commit. Navigation API commits now
reach browser history, and reentrant currententrychange/popstate handlers
cannot reorder entries or trigger traversal URL drift assertions.
Cover mixed Navigation, History, and Location sequences through CDP,
including nested callbacks, intercepted/precommit traversals, and cancellation.
Queue each History back/forward/go delta as its own authorized traversal task and resolve the destination when that task runs. Keep the committed traversal position separate from synchronous history mutations, and use the canonical Window history for isolated-world calls. Preserve Navigation API result-bearing traversal behavior.
Cover consecutive and opposite deltas, initially out-of-range requests, synchronous pushState, canceled and reentrant traversals, child documents, and isolated worlds. Update old coalescing assertions and wait for actual browser-owned history commits in protocol tests.
Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast (17584 passed, 13 skipped). Overlapping navigation WPT improves from 16/22 to 18/22, with both new cases passing all 8 subtests. Navigation API comparison preserves all 385 previously passing cases out of 432.
CDP smoke: 41/43 passed. The dom-input FileList upload failure reproduces on the parent binary; puppeteer could not start because Node is missing locally. Artifacts: target/wpt-history-traversal-20260908-lcpQpn/{before,confirmed,navigation-after,cdp,cdp-before}.