Description
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.
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:
- 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?
- Let realm be the value of execution context's Realm component.
- Let window be realm's global object.
How then does the document get associated to the window?