blob: 3d3ab61e632d63ccc10612cb9d4a6ee7314c4f2d [file] [log] [blame] [view]
Fergal Daly1242e4f2020-04-14 04:26:271# What is RenderDocument?
2
3## TL;DR
4
Fergal Daly788154c92020-04-27 05:34:345Chrome currently switches to a new RenderFrameHost
6when loading a new document
7if the render process is different to the previous one.
8The RenderDocument project is about making the switch to happen unconditionally.
9This:
10
11* Eliminates the logic for navigating inside the same RenderFrameHost
12* Makes RenderFrameHost in the browser process 1:1 with the Document.
13* Prevents security bugs,
14 e.g. reusing the data/capabilities from the wrong document.
Fergal Daly1242e4f2020-04-14 04:26:2715
16## Details
17
18Previously when we navigate a frame from one page to another,
19the second page may appear in a new RenderFrame
20or we may reuse the existing RenderFrame to load the second page.
21Which happens depends on many things,
22including which site-isolation policy we are following
23and whether the pages are from the same site or not.
24With RenderDocument,
25the second page will always use a new RenderFrame
26(excluding navigation within a document).
27
28Also when reloading a crashed frame
29we reused the browser-side RenderFrameHost.
30With RenderDocument we create a new RenderFrameHost
31for crashed frames.
32
33## Read more
34
35https://crbug.com/936696
36
Fergal Daly788154c92020-04-27 05:34:3437[design doc](https://docs.google.com/document/d/1C2VKkFRSc0kdmqjKan1G4NlNlxWZqE4Wam41FNMgnmA)
38
Fergal Daly1242e4f2020-04-14 04:26:2739[high-level view of the work needed](https://docs.google.com/document/d/1UzVOmTj2IJ0ecz7CZicTK6ow2rr9wgLTGfY5hjyLmT4)
40
41[discussion of how we can land it safely](https://docs.google.com/document/d/1ZHWWEYT1L5Zgh2lpC7DHXXZjKcptI877KKOqjqxE2Ns)
42
43# Stages
44
Fergal Daly788154c92020-04-27 05:34:3445We have 3 stages that are behind flags.
Fergal Daly1242e4f2020-04-14 04:26:2746
471. crashed-frames:
Karl Police4855222c2021-03-17 00:49:0048 A new `RenderFrameHost` is used for reloading a crashed document.
Fergal Daly1242e4f2020-04-14 04:26:27492. subframes:
Karl Police4855222c2021-03-17 00:49:0050 A new `RenderFrameHost` is used for every nested document.
Fergal Daly1242e4f2020-04-14 04:26:27513. main frames:
Karl Police4855222c2021-03-17 00:49:0052 A new `RenderFrameHost` is used for every document.
Fergal Daly1242e4f2020-04-14 04:26:2753
54# Test changes
55
56## RenderFrameHost reference becomes invalid
57
58Enabling this for subframes and main frames causes many tests to fail.
59It is common for tests to get a reference to a RenderFrameHost
60and then navigate that frame,
61assuming that the reference will remain valid.
62This assumption is no longer valid.
63The test needs to get a reference to the new RenderFrameHost,
64e.g. by traversing the frame tree again.