Skip to content

What is the relevant global object for the newly created document #11346

Open
@dSalieri

Description

@dSalieri

What is the issue with the HTML Standard?

If you look at the create a new browsing context and document algorithm, you'll notice that it creates a document object in step 15, but doesn't associate it with the window object in any way.

  1. Let document be a new Document, with:

    type "html"
    content type "text/html"
    mode "quirks"
    origin origin
    browsing context browsingContext
    permissions policy permissionsPolicy
    active sandboxing flag set sandboxFlags
    load timing info loadTimingInfo
    is initial about:blank true
    about base URL creatorBaseURL
    allow declarative shadow roots true
    custom element registry a new CustomElementRegistry object

And then the problem arises in step 20, which calls the make active algorithm and passes the created document. The first line that appears in it is:

  1. Let window be document's relevant global object.

And here it is not entirely clear what window will be equal to? I understand what relevant global object is. What will be [[Realm]] for the specified document?


By the way, why not take window for make active as it happens in step 2 of the set up a window environment settings object algorithm?

  1. Let realm be the value of execution context's Realm component.
  2. Let window be realm's global object.

How then does the document get associated to the window?

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