Skip to content

Initializing a document from a response #1445

@annevk

Description

@annevk

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions