Snapshot retiring frame documents and finish their beforeunload phase before
actual unload delivery. Preserve ancestor unload counters through descendant
callbacks and check exact owners before dispatching further events.
Retain visibility state on the native Document and dispatch trusted, bubbling
visibilitychange events through the host event path. Use native unload
counters to suppress navigation during visibility and ancestor callbacks;
cancel each retiring window's timers after its unload.
Eight Browser integration tests cover 50 scenarios. The 181-case WPT
comparison gains two passing cases and seven passing subtests without
regressions; update the passed ledger to 9,101 cases.
Validation: cargo fmt --all; cargo clippy --workspace --all-targets
--all-features -- -D warnings; cargo nextest run --no-fail-fast
(17,910 passed, 13 skipped). Rebuilt CLI matches the tested WPT binary.
A child javascript URL string result must unload the old document without
checking whether unloading is canceled. Reuse the existing teardown that
dispatches pagehide, visibilitychange, and unload, and cancels old timers.
Apply it to the target and its descendants, capturing document identities
before callbacks can remove or replace them.
Add three Browser integration tests covering 12 scenarios, including
nested frames, unrelated frames, non-string completion, ordinary
navigation, and attempts to navigate or schedule timers during unload.
Record the newly passing javascript-url-no-beforeunload WPT.
Validation: cargo fmt --all; workspace all-targets all-features Clippy
with -D warnings; cargo nextest run --no-fail-fast (17,904 passed,
13 skipped). Focused WPT: 110 cases, one new pass / two passing subtest
gains, no regressions.