Skip to content

Commit

Permalink
[giow] (2) Make sure to say to queue a task for a variety of situatio…
Browse files Browse the repository at this point in the history
…ns that otherwise would have synchronous or undefined behaviour. Release the storage mutex in a few places that were missed before.

git-svn-id: http://svn.whatwg.org/webapps@4395 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Dec 2, 2009
1 parent 3f466dc commit c44a8cd
Show file tree
Hide file tree
Showing 3 changed files with 150 additions and 90 deletions.
79 changes: 49 additions & 30 deletions complete.html
Expand Up @@ -9798,6 +9798,8 @@ <h4 id=opening-the-input-stream><span class=secno>3.5.1 </span>Opening the input

</li>

<li><p>Release the <a href=#storage-mutex>storage mutex</a>.</li>

<li><p><a href=#prompt-to-unload-a-document title="prompt to unload a document">Prompt to
unload</a> the <code>Document</code> object. If the user
<a href=#refused-to-allow-the-document-to-be-unloaded>refused to allow the document to be unloaded</a>, then
Expand Down Expand Up @@ -20315,11 +20317,14 @@ <h4 id=the-iframe-element><span class=secno>4.8.3 </span>The <dfn><code>iframe</
name</a> must be set to the empty string.</p>

<p>When content loads in an <code><a href=#the-iframe-element>iframe</a></code>, after any <code title=event-load>load</code> events are fired within the content
itself, the user agent must <a href=#fire-a-simple-event>fire a simple event</a> named
<code title=event-load>load</code> at the <code><a href=#the-iframe-element>iframe</a></code>
element. When content fails to load (e.g. due to a network error),
then the user agent must <a href=#fire-a-simple-event>fire a simple event</a> named
<code title=event-error>error</code> at the element instead.</p>
itself, the user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire
a simple event</a> named <code title=event-load>load</code> at
the <code><a href=#the-iframe-element>iframe</a></code> element. When content fails to load
(e.g. due to a network error), then the user agent must <a href=#queue-a-task>queue
a task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-error>error</code> at the element instead.</p>

<p>The <a href=#task-source>task source</a> for these <a href=#concept-task title=concept-task>tasks</a> is the <a href=#dom-manipulation-task-source>DOM manipulation
task source</a>.</p>

<p>When there is an <a href=#active-parser>active parser</a> in the
<code><a href=#the-iframe-element>iframe</a></code>, and when anything in the <code><a href=#the-iframe-element>iframe</a></code> is
Expand Down Expand Up @@ -21058,8 +21063,9 @@ <h4 id=the-object-element><span class=secno>4.8.5 </span>The <dfn><code>object</
whenever its <code title=attr-object-data><a href=#attr-object-data>data</a></code> attribute is
set, changed, or removed; and, when neither its <code title=attr-object-classid><a href=#attr-object-classid>classid</a></code> attribute nor its <code title=attr-object-data><a href=#attr-object-data>data</a></code> attribute are present, whenever
its <code title=attr-object-type><a href=#attr-object-type>type</a></code> attribute is set,
changed, or removed: the user agent must run the following steps to
(re)determine what the <code><a href=#the-object-element>object</a></code> element represents:</p>
changed, or removed: the user agent must <a href=#queue-a-task>queue a task</a>
to run the following steps to (re)determine what the
<code><a href=#the-object-element>object</a></code> element represents:</p>
<!-- Changing the base URL doesn't trigger this. -->

<ol><li>
Expand Down Expand Up @@ -21381,7 +21387,10 @@ <h4 id=the-object-element><span class=secno>4.8.5 </span>The <dfn><code>object</
<a href=#fallback-content>fallback content</a>. If the element has an instantiated
<a href=#plugin>plugin</a>, then unload it.</li>

</ol><p id=object-plugin>When the algorithm above instantiates a
</ol><p>The <a href=#task-source>task source</a> for the <a href=#concept-task title=concept-task>task</a> above is the <a href=#dom-manipulation-task-source>DOM manipulation
task source</a>.</p>

<p id=object-plugin>When the algorithm above instantiates a
<a href=#plugin>plugin</a>, the user agent should pass the names and values
of all the attributes on the element, and <!-- then a parameter
named "PARAM" whose value is null, and then --> all the names and
Expand Down Expand Up @@ -54772,13 +54781,15 @@ <h4 id=browser-state><span class=secno>6.9.9 </span>Browser state</h4>

<p>When the value that would be returned by the <code title=dom-navigator-onLine><a href=#dom-navigator-online>navigator.onLine</a></code> attribute of
the <code><a href=#window>Window</a></code> changes from true to false, the user agent
must <a href=#fire-a-simple-event>fire a simple event</a> named <dfn id=event-offline title=event-offline><code>offline</code></dfn> at the
must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a>
named <dfn id=event-offline title=event-offline><code>offline</code></dfn> at the
<code><a href=#window>Window</a></code> object.</p>

<p>On the other hand, when the value that would be returned by the
<code title=dom-navigator-onLine><a href=#dom-navigator-online>navigator.onLine</a></code> attribute
of the <code><a href=#window>Window</a></code> changes from false to true, the user
agent must <a href=#fire-a-simple-event>fire a simple event</a> named <dfn id=event-online title=event-online><code>online</code></dfn> at the
agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple
event</a> named <dfn id=event-online title=event-online><code>online</code></dfn> at the
<code><a href=#window>Window</a></code> object.</p>

<p>The <a href=#task-source>task source</a> for these <a href=#concept-task title=concept-task>tasks</a> is the <a href=#networking-task-source>networking task
Expand Down Expand Up @@ -55016,12 +55027,6 @@ <h4 id=the-history-interface><span class=secno>6.10.2 </span>The <code><a href=#
<a href=#browsing-context>browsing context</a> of the <var title="">specified
entry</var>.</li>

<li><p>If the <code>Document</code> of the <var title="">specified
entry</var> of the <var title="">specified browsing context</var>
is not the same as the <code>Document</code> of the <a href=#current-entry>current
entry</a> of the <var title="">specified browsing context</var>,
then release the <a href=#storage-mutex>storage mutex</a>.</li>

<li><p><a href=#traverse-the-history>Traverse the history</a> of the <var title="">specified browsing context</var> to the <var title="">specified entry</var>.</p>

</ol><p>When the user navigates through a <a href=#browsing-context>browsing context</a>,
Expand Down Expand Up @@ -55593,7 +55598,9 @@ <h4 id=navigating-across-documents><span class=secno>6.11.1 </span>Navigating ac
<p>When a browsing context is <dfn id=navigate title=navigate>navigated</dfn>
to a new resource, the user agent must run the following steps:</p>

<ol><li id=sandboxLinks><p>If the <a href=#source-browsing-context>source browsing
<ol><li><p>Release the <a href=#storage-mutex>storage mutex</a>.</li>

<li id=sandboxLinks><p>If the <a href=#source-browsing-context>source browsing
context</a> is not the same as the <a href=#browsing-context>browsing context</a>
being navigated, and the <a href=#source-browsing-context>source browsing context</a> is
not one of the <a href=#ancestor-browsing-context title="ancestor browsing context">ancestor
Expand Down Expand Up @@ -56320,6 +56327,8 @@ <h4 id=history-traversal><span class=secno>6.11.9 </span>History traversal</h4>
created. (This can never happen with <a href=#replacement-enabled>replacement
enabled</a>.)</li>

<li><p>Release the <a href=#storage-mutex>storage mutex</a>.</li>

<li>

<p>If appropriate, update the <a href=#current-entry>current entry</a> in the
Expand Down Expand Up @@ -56418,6 +56427,8 @@ <h4 id=history-traversal><span class=secno>6.11.9 </span>History traversal</h4>
synchronously <a href=#fire-a-simple-event>fire a simple event</a> with the name <code title=event-hashchange>hashchange</code> at the <a href=#browsing-context>browsing
context</a>'s <code><a href=#window>Window</a></code> object.</li>

<li><p>Release the <a href=#storage-mutex>storage mutex</a> again.</li>

<li><p>The <a href=#current-entry>current entry</a> is now the <i>specified
entry</i>.</li>

Expand All @@ -56441,6 +56452,8 @@ <h4 id=unloading-documents><span class=secno>6.11.10 </span>Unloading documents<
<li><p>Dispatch <var title="">event</var> at the
<code>Document</code>'s <code><a href=#window>Window</a></code> object.</li>

<li><p>Release the <a href=#storage-mutex>storage mutex</a>.</li>

<li><p>If any event listeners were triggered by the previous step,
then set the <code>Document</code>'s <var title="">salvageable</var> state to false.</li>

Expand Down Expand Up @@ -56476,6 +56489,8 @@ <h4 id=unloading-documents><span class=secno>6.11.10 </span>Unloading documents<
<li><p><a href=#fire-a-simple-event>Fire a simple event</a> named <code title=event-unload>unload</code> at the <code>Document</code>'s
<code><a href=#window>Window</a></code> object.</li>

<li><p>Release the <a href=#storage-mutex>storage mutex</a>.</li>

<li><p>If any event listeners were triggered by the previous step,
then set the <code>Document</code> object's <var title="">salvageable</var> state to false.</li>

Expand Down Expand Up @@ -56529,8 +56544,9 @@ <h4 id=aborting-a-document-load><span class=secno>6.11.11 </span>Aborting a docu
<p>If the user cancels any instance of the <a href=#fetch title=fetch>fetching algorithm</a> in the context of a
<code>Document</code> in a <a href=#browsing-context>browsing context</a>, then, if
that <code>Document</code> is an <a href=#active-document>active document</a>, the
user agent must <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-abort>abort</code> at that <code>Document</code>'s
<code><a href=#window>Window</a></code> object.</p>
user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple
event</a> named <code title=event-abort>abort</code> at that
<code>Document</code>'s <code><a href=#window>Window</a></code> object.</p>

<!-- I'd love to make this more precise, anyone have any suggestions
on what it should say? -->
Expand Down Expand Up @@ -58935,8 +58951,8 @@ <h4 id=focus-management><span class=secno>8.4.2 </span>Focus management</h4>

<li><p><a href=#fire-a-simple-event>Fire a simple event</a> named <code title=event-focus>focus</code> at the element.</li>

</ol><p>User agents must run the <a href=#focusing-steps>focusing steps</a> for an
element whenever the user moves the focus to a
</ol><p>User agents must synchronously run the <a href=#focusing-steps>focusing
steps</a> for an element whenever the user moves the focus to a
<a href=#focusable>focusable</a> element.</p>

<p>The <dfn id=unfocusing-steps>unfocusing steps</dfn> are as follows:</p>
Expand All @@ -58957,10 +58973,10 @@ <h4 id=focus-management><span class=secno>8.4.2 </span>Focus management</h4>
</ol><p>When an element that is focused stops being a
<a href=#focusable>focusable</a> element, or stops being focused without
another element being explicitly focused in its stead, the user
agent should run the <a href=#focusing-steps>focusing steps</a> for <a href=#the-body-element>the body
element</a>, if there is one; if there is not, then the user
agent should run the <a href=#unfocusing-steps>unfocusing steps</a> for the affected
element only.</p>
agent should synchronously run the <a href=#focusing-steps>focusing steps</a> for
<a href=#the-body-element>the body element</a>, if there is one; if there is not,
then the user agent should synchronously run the <a href=#unfocusing-steps>unfocusing
steps</a> for the affected element only.</p>

<p class=example>For example, this might happen because the
element is removed from its <code>Document</code>, or has a <code title=attr-hidden><a href=#the-hidden-attribute>hidden</a></code> attribute added. It would also
Expand Down Expand Up @@ -81863,11 +81879,14 @@ <h4 id=frames><span class=secno>14.3.3 </span>Frames</h4>
name</a> must be set to the empty string.</p>

<p>When content loads in a <code><a href=#frame>frame</a></code>, after any <code title=event-load>load</code> events are fired within the content
itself, the user agent must <a href=#fire-a-simple-event>fire a simple event</a> named
<code title=event-load>load</code> at the <code><a href=#frame>frame</a></code>
element. When content fails to load (e.g. due to a network error),
then the user agent must <a href=#fire-a-simple-event>fire a simple event</a> named
<code title=event-error>error</code> at the element instead.</p>
itself, the user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire
a simple event</a> named <code title=event-load>load</code> at
the <code><a href=#frame>frame</a></code> element. When content fails to load (e.g. due
to a network error), then the user agent must <a href=#queue-a-task>queue a
task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-error>error</code> at the element instead.</p>

<p>The <a href=#task-source>task source</a> for the <a href=#concept-task title=concept-task>tasks</a> above is the <a href=#dom-manipulation-task-source>DOM
manipulation task source</a>.</p>

<p>When there is an <a href=#active-parser>active parser</a> in the
<code><a href=#frame>frame</a></code>, and when anything in the <code><a href=#frame>frame</a></code> is
Expand Down

0 comments on commit c44a8cd

Please sign in to comment.