<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:155727087;
        mso-list-template-ids:-781164112;}
@list l0:level1
        {mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level2
        {mso-level-tab-stop:1.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level3
        {mso-level-tab-stop:1.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level4
        {mso-level-tab-stop:2.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level5
        {mso-level-tab-stop:2.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level6
        {mso-level-tab-stop:3.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level7
        {mso-level-tab-stop:3.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level8
        {mso-level-tab-stop:4.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level9
        {mso-level-tab-stop:4.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Hi all,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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).<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Specifically:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><a href="http://www.whatwg.org/specs/web-apps/current-work/#read-html">http://www.whatwg.org/specs/web-apps/current-work/#read-html</a>: After creating the <a href="http://www.whatwg.org/specs/web-apps/current-work/#document">Document</a> object,
 but before any script execution, certainly before the parser <a href="http://www.whatwg.org/specs/web-apps/current-work/#stop-parsing" title="stop
  parsing">stops</a>, the user agent must <a href="http://www.whatwg.org/specs/web-apps/current-work/#update-the-session-history-with-the-new-page">update
 the session history with the new page</a>.”<o:p></o:p></p>
<p class="MsoNormal"><a href="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</a>: …The user agent must
<b>queue a task</b> to … #3: The navigation algorithm has now matured.<o:p></o:p></p>
<p class="MsoNormal"><a href="http://www.whatwg.org/specs/web-apps/current-work/#queue-a-task">http://www.whatwg.org/specs/web-apps/current-work/#queue-a-task</a>: “When a user agent is to <b>queue a task</b>, it must add the given task to one of the <a href="http://www.whatwg.org/specs/web-apps/current-work/#task-queue" title="task queue">task
 queues</a> of the relevant <a href="http://www.whatwg.org/specs/web-apps/current-work/#event-loop">event loop</a>.”<o:p></o:p></p>
<p class="MsoNormal"><a href="http://www.whatwg.org/specs/web-apps/current-work/#processing-model-2">http://www.whatwg.org/specs/web-apps/current-work/#processing-model-2</a>: “An <a href="http://www.whatwg.org/specs/web-apps/current-work/#event-loop">event
 loop</a> must continually run through the following steps for as long as it exists:<o:p></o:p></p>
<ol style="margin-top:0in" start="1" type="1">
<li class="MsoNormal" style="mso-list:l0 level1 lfo1">Run the oldest <a href="http://www.whatwg.org/specs/web-apps/current-work/#concept-task" title="concept-task">task</a> on one of the <a href="http://www.whatwg.org/specs/web-apps/current-work/#event-loop">event
 loop</a>'s <a href="http://www.whatwg.org/specs/web-apps/current-work/#task-queue" title="task queue">task queues</a>, ignoring tasks whose associated <a href="http://www.whatwg.org/specs/web-apps/current-work/#document">Document</a>s are not <a href="http://www.whatwg.org/specs/web-apps/current-work/#fully-active">fully
 active</a>.”<o:p></o:p></li></ol>
<p class="MsoNormal"><a href="http://www.whatwg.org/specs/web-apps/current-work/#fully-active">http://www.whatwg.org/specs/web-apps/current-work/#fully-active</a>: “A <a href="http://www.whatwg.org/specs/web-apps/current-work/#document">Document</a> is said
 to be <b>fully active</b> when it is the <a href="http://www.whatwg.org/specs/web-apps/current-work/#active-document">active document</a> of its <a href="http://www.whatwg.org/specs/web-apps/current-work/#browsing-context">browsing context</a>, and …”<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">Ben Lerner<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>