-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
One problem I keep running into is to how exactly initialize a document. The way we do this at the moment is not very principled.
initial about:blank response: state comes from the creator browsing context (parent, opener, or missing) and in particular, if not missing, its active document.
about:blank URL response: state comes from the response, which is put there by Fetch, sometimes (from source browsing context's active document).
about:srcdoc response: state comes from the response which is put there by HTML, sometimes (from the parent browsing context's active document).
blob/data URL response: state comes from the response, which is put there by Fetch, sometimes, e.g., whatwg/fetch#306 is not (again, from source browsing context's active document's relevant settings object). (Though note how origin is set weirdly different.)
javascript URL response: state comes from the navigated browsing context's active document.
HTTP URL response: state comes from the response, not really a problem.
This is a giant mess. I don't think we should continue with this setup. Adding state in lots of places is very error prone. We have a couple of responses for which we need to inherit state and we should just define that inherited state in a single place, including where it originates. Most sensible seems parent or opener, and if those don't exist some kind of default.