Join GitHub today
Browsing context hierarchy needs to go through the embedding document #5020
Grabbing the parent browsing context or top-level browsing context is rather problematic. In particular when then their active document or some such is consulted.
@bzbarsky has raised this many times.
To prevent these kind of issues we should make browsing contexts explicitly point to their embedding element and make all traversal go through that and then define convenient short hands for top-level document, parent document, and such.
This would also help with defining new concepts such as top-level origin, without having to explicitly forward such state downward.
Example: if you navigate a popup from A to A' and A embeds B and A' does not, when you arrive at A' and look at B's
This issue is related to browsing context's "sleepy state" not being defined. In particular if you go back from A' to A and A was in the bfcache, the browsing context from B is still there and cannot have been discarded, but this is not really defined either way. In part I suppose whether we need to resolve this depends on how bfcache ends up being designed, but I suspect we will need to solve it given what existing user agents are iterating towards.
This generally sets out the infrastructure for a more secure model for working with browsing contexts, as outlined in #5020. * Adds browsing context's container * Adds browsing context's container document * Makes "update the rendering" account for browsing contexts in shadow trees * Removes nested through; closes #4409.