Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document object created before Window object #2688

Closed
annevk opened this issue May 16, 2017 · 2 comments
Closed

Document object created before Window object #2688

annevk opened this issue May 16, 2017 · 2 comments

Comments

@annevk
Copy link
Member

annevk commented May 16, 2017

#2657 has some ideas on how to do a better job here, although even that is not entirely correct. To fix whatwg/dom#221 properly we need to know ahead of time what kind of Document object to create.

But the rough outline of creating a global, then creating the appropriate document and initializing it, and then replacing the old document if still needed, is probably right. We can even allocate the global and document and throw them away later based on metadata, but the only case where that makes sense is the XML namespace-based dispatching, and it's not clear to me that actually works (see #2656).

It seems ideally navigate goes async, then at some point once we have a response we queue a task that creates the new global, document, unloads the old, and then replaces old with new, all in the same task. The current setup with multiple tasks seems rather weird and likely wrong.

(Note that it might have to become more complicated since the task for the new document could be a distinct task from unloading the old document if we cross agent boundaries. Baby steps though.)

@annevk
Copy link
Member Author

annevk commented May 16, 2017

See also #1445.

@annevk
Copy link
Member Author

annevk commented Jan 23, 2019

Duplicate of #2455.

@annevk annevk closed this as completed Jan 23, 2019
domenic pushed a commit that referenced this issue Dec 3, 2020
Fixes #2455 by passing the creation URL to "set up a window
environment's settings object", instead of having it attempt to grab the
creation URL from the not-yet-created Document object.

The later comments in #2455 discuss some followup work we could do to
clarify the Document/Window relationship, but that is left for a future
commit.

This also removes the XXX box mentioned in #2688, since Documents are
nowadays created after Windows in the spec.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants
@annevk and others