W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2010

[whatwg] Navigation maturation and event loops

From: Ben Lerner <t-benle@microsoft.com>
Date: Wed, 23 Jun 2010 17:50:58 +0000
Message-ID: <2B307CC5A6F1D44A8FBD8E029A770BCA203EAE82@TK5EX14MBXC115.redmond.corp.microsoft.com>
Hi all,

I'm trying to figure out the control flow when documents are loaded and navigated, and I think there's a deadlock situation (at least as I'm currently reading the spec).

Specifically:

http://www.whatwg.org/specs/web-apps/current-work/#read-html: After creating the Document<http://www.whatwg.org/specs/web-apps/current-work/#document> object, but before any script execution, certainly before the parser stops<http://www.whatwg.org/specs/web-apps/current-work/#stop-parsing>, the user agent must update the session history with the new page<http://www.whatwg.org/specs/web-apps/current-work/#update-the-session-history-with-the-new-page>."
http://www.whatwg.org/specs/web-apps/current-work/#update-the-session-history-with-the-new-page: ...The user agent must queue a task to ... #3: The navigation algorithm has now matured.
http://www.whatwg.org/specs/web-apps/current-work/#queue-a-task: "When a user agent is to queue a task, it must add the given task to one of the task queues<http://www.whatwg.org/specs/web-apps/current-work/#task-queue> of the relevant event loop<http://www.whatwg.org/specs/web-apps/current-work/#event-loop>."
http://www.whatwg.org/specs/web-apps/current-work/#processing-model-2: "An event loop<http://www.whatwg.org/specs/web-apps/current-work/#event-loop> must continually run through the following steps for as long as it exists:

  1.  Run the oldest task<http://www.whatwg.org/specs/web-apps/current-work/#concept-task> on one of the event loop<http://www.whatwg.org/specs/web-apps/current-work/#event-loop>'s task queues<http://www.whatwg.org/specs/web-apps/current-work/#task-queue>, ignoring tasks whose associated Document<http://www.whatwg.org/specs/web-apps/current-work/#document>s are not fully active<http://www.whatwg.org/specs/web-apps/current-work/#fully-active>."
http://www.whatwg.org/specs/web-apps/current-work/#fully-active: "A Document<http://www.whatwg.org/specs/web-apps/current-work/#document> is said to be fully active when it is the active document<http://www.whatwg.org/specs/web-apps/current-work/#active-document> of its browsing context<http://www.whatwg.org/specs/web-apps/current-work/#browsing-context>, and ..."

So if I'm reading that chain right: I need to queue a task that will mature the navigation algorithm, which will make the document the active document, except that the task will not run because the document is not yet the active document and hence not fully active.  The loophole here is the phrase "relevant event loop".  Is there an event loop that is relevant and that is also associated with a fully-active document?

Thanks,
Ben Lerner

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20100623/0dbbc26d/attachment.htm>
Received on Wednesday, 23 June 2010 10:50:58 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:24 UTC