Navigation Menu

Skip to content

Commit

Permalink
[giow] (2) Fix a race condition between setting src and firing onload…
Browse files Browse the repository at this point in the history
… for <img>.

git-svn-id: http://svn.whatwg.org/webapps@6731 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Oct 24, 2011
1 parent 402156e commit 77cb7e1
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 29 deletions.
21 changes: 12 additions & 9 deletions complete.html
Expand Up @@ -240,7 +240,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 21 October 2011</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 24 October 2011</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
Expand Down Expand Up @@ -22443,15 +22443,17 @@ <h4 id=the-img-element><span class=secno>4.8.1 </span>The <dfn><code>img</code><
<dl class=switch><dt>If the download was successful</dt>

<dd>Set the <code><a href=#the-img-element>img</a></code> element to the <a href=#img-all title=img-all>completely available</a> state, update the
presentation of the image appropriately, and <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-img-element>img</a></code>
element.</dd>
presentation of the image appropriately, and <a href=#fire-a-simple-event>fire a simple
event</a> named <code title=event-load>load</code> at the
<code><a href=#the-img-element>img</a></code> element.</dd>

<!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1222 -->

<dt>Otherwise</dt>

<dd>Set the <code><a href=#the-img-element>img</a></code> element to the <a href=#img-error title=img-error>broken</a> state, and <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 <code><a href=#the-img-element>img</a></code>
element.</dd>
<dd>Set the <code><a href=#the-img-element>img</a></code> element to the <a href=#img-error title=img-error>broken</a> state, and <a href=#fire-a-simple-event>fire a simple
event</a> named <code title=event-error>error</code> at the
<code><a href=#the-img-element>img</a></code> element.</dd>

</dl><p>On the other hand, if the resource type is
<code><a href=#multipart/x-mixed-replace>multipart/x-mixed-replace</a></code>, then each <a href=#concept-task title=concept-task>task</a> that is <a href=#queue-a-task title="queue a
Expand Down Expand Up @@ -22509,8 +22511,9 @@ <h4 id=the-img-element><span class=secno>4.8.1 </span>The <dfn><code>img</code><
<p>This specification does not specify which image types are to be
supported.</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>The <a href=#task-source>task source</a> for the <a href=#concept-task title=concept-task>tasks</a> <a href=#queue-a-task title="queue a
task">queued</a> by algorithms in this section is the <a href=#dom-manipulation-task-source>DOM
manipulation task source</a>.</p>

<hr><p>What an <code><a href=#the-img-element>img</a></code> element represents depends on the <code title=attr-img-src><a href=#attr-img-src>src</a></code> attribute and the <code title=attr-img-alt><a href=#attr-img-alt>alt</a></code> attribute.</p>

Expand Down
21 changes: 12 additions & 9 deletions index
Expand Up @@ -240,7 +240,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 21 October 2011</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 24 October 2011</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
Expand Down Expand Up @@ -22443,15 +22443,17 @@ interface <dfn id=htmlimageelement>HTMLImageElement</dfn> : <a href=#htmlelement
<dl class=switch><dt>If the download was successful</dt>

<dd>Set the <code><a href=#the-img-element>img</a></code> element to the <a href=#img-all title=img-all>completely available</a> state, update the
presentation of the image appropriately, and <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-img-element>img</a></code>
element.</dd>
presentation of the image appropriately, and <a href=#fire-a-simple-event>fire a simple
event</a> named <code title=event-load>load</code> at the
<code><a href=#the-img-element>img</a></code> element.</dd>

<!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1222 -->

<dt>Otherwise</dt>

<dd>Set the <code><a href=#the-img-element>img</a></code> element to the <a href=#img-error title=img-error>broken</a> state, and <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 <code><a href=#the-img-element>img</a></code>
element.</dd>
<dd>Set the <code><a href=#the-img-element>img</a></code> element to the <a href=#img-error title=img-error>broken</a> state, and <a href=#fire-a-simple-event>fire a simple
event</a> named <code title=event-error>error</code> at the
<code><a href=#the-img-element>img</a></code> element.</dd>

</dl><p>On the other hand, if the resource type is
<code><a href=#multipart/x-mixed-replace>multipart/x-mixed-replace</a></code>, then each <a href=#concept-task title=concept-task>task</a> that is <a href=#queue-a-task title="queue a
Expand Down Expand Up @@ -22509,8 +22511,9 @@ interface <dfn id=htmlimageelement>HTMLImageElement</dfn> : <a href=#htmlelement
<p>This specification does not specify which image types are to be
supported.</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>The <a href=#task-source>task source</a> for the <a href=#concept-task title=concept-task>tasks</a> <a href=#queue-a-task title="queue a
task">queued</a> by algorithms in this section is the <a href=#dom-manipulation-task-source>DOM
manipulation task source</a>.</p>

<hr><p>What an <code><a href=#the-img-element>img</a></code> element represents depends on the <code title=attr-img-src><a href=#attr-img-src>src</a></code> attribute and the <code title=attr-img-alt><a href=#attr-img-alt>alt</a></code> attribute.</p>

Expand Down
23 changes: 12 additions & 11 deletions source
Expand Up @@ -23995,18 +23995,18 @@ interface <dfn>HTMLImageElement</dfn> : <span>HTMLElement</span> {

<dd>Set the <code>img</code> element to the <span
title="img-all">completely available</span> state, update the
presentation of the image appropriately, and <span>queue a
task</span> to <span>fire a simple event</span> named <code
title="event-load">load</code> at the <code>img</code>
element.</dd>
presentation of the image appropriately, and <span>fire a simple
event</span> named <code title="event-load">load</code> at the
<code>img</code> element.</dd>

<!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1222 -->

<dt>Otherwise</dt>

<dd>Set the <code>img</code> element to the <span
title="img-error">broken</span> state, and <span>queue a
task</span> to <span>fire a simple event</span> named <code
title="event-error">error</code> at the <code>img</code>
element.</dd>
title="img-error">broken</span> state, and <span>fire a simple
event</span> named <code title="event-error">error</code> at the
<code>img</code> element.</dd>

</dl>

Expand Down Expand Up @@ -24075,9 +24075,10 @@ interface <dfn>HTMLImageElement</dfn> : <span>HTMLElement</span> {
<p>This specification does not specify which image types are to be
supported.</p>

<p>The <span>task source</span> for these <span
title="concept-task">tasks</span> is the <span>DOM manipulation
task source</span>.</p>
<p>The <span>task source</span> for the <span
title="concept-task">tasks</span> <span title="queue a
task">queued</span> by algorithms in this section is the <span>DOM
manipulation task source</span>.</p>

<hr>

Expand Down

0 comments on commit 77cb7e1

Please sign in to comment.