Document-Isolation-Policy documents in cross-origin isolated processes
Component: WebKit Site Isolation | 9826f00
LayoutTests/imported/w3c/web-platform-tests/html/document-isolation-policy/agent-cluster.tentative.https.html
agent-cluster.tentative.https-expected.txt
COOP already works as a response-driven process swap: the network process sees the header and asks the UI process to move the navigation into a different process. Document-Isolation-Policy (DIP), a per-document alternative to COOP+COEP, extends this to individual frames, granting crossOriginIsolated and SharedArrayBuffer without isolating the whole page. That means each browsing context group's process map is now keyed by site plus a "has policy" flag.
With site isolation, a DIP document now goes into a cross-origin isolated process that its browsing context group keeps for the site, where crossOriginIsolated is true and SharedArrayBuffer can be posted within the agent cluster. Because the policy is known only from the response, the network process asks the UI process for a swap when the first response's policy doesn't match the current process, and the navigation continues on the same network load. The UI process refuses to commit a policy-less response in a DIP process. 204/205 responses don't swap, and 304s on cross-process-capable navigations reload instead of revalidating.
Significance
DIP-based cross-origin isolation is now enforced by process boundaries rather than only by in-process agent-cluster checks. The change also adds a new network-to-UI swap path and lets same-origin documents live in different processes, which is a classic source of races between the network process, UI process, and renderer.
Audit directions
The commit itself lists gaps, and they point at a wider pattern of process choice corrected after a load has started. Narrow: the new network-to-UI swap IPC carries a URL and raw policy header and runs mid-load while the load moves to another process. Check it for races with redirects, early termination, and multiple swap requests on one load. Also check the consistency between a process's recorded isolation reason, the policy the document actually applies, and the process-map key; a mismatch could hand SharedArrayBuffer to a document that shouldn't have it. Wider: same-origin documents in different processes mean "may navigate frame" checks must count ancestors elsewhere, and the commit notes that the navigate event is not fired for a same origin-domain cross-process navigation landing in a third process. Dedicated workers of DIP documents are not isolated, so SharedArrayBuffer and WebAssembly.Module posting across that boundary deserve scrutiny. Edge cases: 304 vs reload, the 204/205 exemption, top-level data: documents inheriting policy, and prefetch reuse when the policy differs or hasn't arrived yet.