Document object created before Window object #2688

Open
annevk opened this Issue May 16, 2017 · 1 comment

Comments

1 participant
@annevk
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

This comment has been minimized.

Show comment
Hide comment
@annevk

annevk May 16, 2017

Member

See also #1445.

Member

annevk commented May 16, 2017

See also #1445.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment