Skip to content

Commit

Permalink
[giow] (0) Make onerror on <img> only fire when onload doesn't fire.
Browse files Browse the repository at this point in the history
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=15000
Affected topics: HTML

git-svn-id: http://svn.whatwg.org/webapps@7349 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Sep 15, 2012
1 parent 8a47c16 commit 8eff91c
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 44 deletions.
29 changes: 15 additions & 14 deletions complete.html
Expand Up @@ -246,7 +246,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 14 September 2012</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 15 September 2012</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 @@ -24446,12 +24446,14 @@ <h4 id=the-img-element><span class=secno>4.8.1 </span>The <dfn><code>img</code><
<dd>The user agent has obtained some of the image data.</dd>

<dt><dfn id=img-all title=img-all>Completely available</dfn></dt>
<dd>The user agent has obtained all of the image data.</dd>
<dd>The user agent has obtained all of the image data and at least
the image dimensions are available.</dd>

<dt><dfn id=img-error title=img-error>Broken</dfn></dt>
<dd>The user agent has obtained all of the image data that it can,
but it cannot decode the image (e.g. the image is corrupted, or the
format is not supported, or no data could be obtained).</dd>
but it cannot even decode the image enough to get the image
dimensions (e.g. the image is corrupted, or the format is not
supported, or no data could be obtained).</dd>

</dl><p>When an <code><a href=#the-img-element>img</a></code> element is either in the <a href=#img-inc title=img-inc>partially available</a> state or in the <a href=#img-all title=img-all>completely available</a> state, it is said to be
<dfn id=img-available title=img-available>available</dfn>.</p>
Expand Down Expand Up @@ -24647,7 +24649,7 @@ <h4 id=the-img-element><span class=secno>4.8.1 </span>The <dfn><code>img</code><
source</a> once the resource has been <a href=#fetch title=fetch>fetched</a> must act as appropriate given the
following alternatives:</p>

<dl class=switch><dt>If the download was successful</dt>
<dl class=switch><dt>If the download was successful and the user agent was able to determine the image's width and height</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, add the image to the
Expand Down Expand Up @@ -24675,15 +24677,14 @@ <h4 id=the-img-element><span class=secno>4.8.1 </span>The <dfn><code>img</code><
a simple event</a> named <code title=event-load>load</code>
at the <code><a href=#the-img-element>img</a></code> element.</p>

<p>If at any point the user agent discovers that the image data is
corrupted in some fatal way, or that the image data is not in a
supported file format, then the user agent must set the
<code><a href=#the-img-element>img</a></code> element to the <a href=#img-error title=img-error>broken</a> state. If the <a href=#fetch title=fetch>fetching</a> algorithm is still running for this
element, then the user agent must also abort that algorithm,
discarding any pending <a href=#concept-task title=concept-task>tasks</a>
generated by that algorithm, and then <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.</p>
<p>Otherwise, either the image data is corrupted in some fatal way
such that the image dimensions cannot be obtained, or the image
data is not in a supported file format; the user agent must set
the <code><a href=#the-img-element>img</a></code> element to the <a href=#img-error title=img-error>broken</a> state, abort the <a href=#fetch title=fetch>fetching</a> algorithm, discarding any pending
<a href=#concept-task title=concept-task>tasks</a> generated by that
algorithm, and then <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.</p>

</li>

Expand Down
29 changes: 15 additions & 14 deletions index
Expand Up @@ -246,7 +246,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 14 September 2012</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 15 September 2012</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 @@ -24446,12 +24446,14 @@ interface <dfn id=htmlimageelement>HTMLImageElement</dfn> : <a href=#htmlelement
<dd>The user agent has obtained some of the image data.</dd>

<dt><dfn id=img-all title=img-all>Completely available</dfn></dt>
<dd>The user agent has obtained all of the image data.</dd>
<dd>The user agent has obtained all of the image data and at least
the image dimensions are available.</dd>

<dt><dfn id=img-error title=img-error>Broken</dfn></dt>
<dd>The user agent has obtained all of the image data that it can,
but it cannot decode the image (e.g. the image is corrupted, or the
format is not supported, or no data could be obtained).</dd>
but it cannot even decode the image enough to get the image
dimensions (e.g. the image is corrupted, or the format is not
supported, or no data could be obtained).</dd>

</dl><p>When an <code><a href=#the-img-element>img</a></code> element is either in the <a href=#img-inc title=img-inc>partially available</a> state or in the <a href=#img-all title=img-all>completely available</a> state, it is said to be
<dfn id=img-available title=img-available>available</dfn>.</p>
Expand Down Expand Up @@ -24647,7 +24649,7 @@ interface <dfn id=htmlimageelement>HTMLImageElement</dfn> : <a href=#htmlelement
source</a> once the resource has been <a href=#fetch title=fetch>fetched</a> must act as appropriate given the
following alternatives:</p>

<dl class=switch><dt>If the download was successful</dt>
<dl class=switch><dt>If the download was successful and the user agent was able to determine the image's width and height</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, add the image to the
Expand Down Expand Up @@ -24675,15 +24677,14 @@ interface <dfn id=htmlimageelement>HTMLImageElement</dfn> : <a href=#htmlelement
a simple event</a> named <code title=event-load>load</code>
at the <code><a href=#the-img-element>img</a></code> element.</p>

<p>If at any point the user agent discovers that the image data is
corrupted in some fatal way, or that the image data is not in a
supported file format, then the user agent must set the
<code><a href=#the-img-element>img</a></code> element to the <a href=#img-error title=img-error>broken</a> state. If the <a href=#fetch title=fetch>fetching</a> algorithm is still running for this
element, then the user agent must also abort that algorithm,
discarding any pending <a href=#concept-task title=concept-task>tasks</a>
generated by that algorithm, and then <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.</p>
<p>Otherwise, either the image data is corrupted in some fatal way
such that the image dimensions cannot be obtained, or the image
data is not in a supported file format; the user agent must set
the <code><a href=#the-img-element>img</a></code> element to the <a href=#img-error title=img-error>broken</a> state, abort the <a href=#fetch title=fetch>fetching</a> algorithm, discarding any pending
<a href=#concept-task title=concept-task>tasks</a> generated by that
algorithm, and then <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.</p>

</li>

Expand Down
32 changes: 16 additions & 16 deletions source
Expand Up @@ -26255,12 +26255,14 @@ interface <dfn>HTMLImageElement</dfn> : <span>HTMLElement</span> {
<dd>The user agent has obtained some of the image data.</dd>

<dt><dfn title="img-all">Completely available</dfn></dt>
<dd>The user agent has obtained all of the image data.</dd>
<dd>The user agent has obtained all of the image data and at least
the image dimensions are available.</dd>

<dt><dfn title="img-error">Broken</dfn></dt>
<dd>The user agent has obtained all of the image data that it can,
but it cannot decode the image (e.g. the image is corrupted, or the
format is not supported, or no data could be obtained).</dd>
but it cannot even decode the image enough to get the image
dimensions (e.g. the image is corrupted, or the format is not
supported, or no data could be obtained).</dd>

</dl>

Expand Down Expand Up @@ -26488,7 +26490,7 @@ interface <dfn>HTMLImageElement</dfn> : <span>HTMLElement</span> {

<dl class="switch">

<dt>If the download was successful</dt>
<dt>If the download was successful and the user agent was able to determine the image's width and height</dt>

<dd>Set the <code>img</code> element to the <span
title="img-all">completely available</span> state, update the
Expand Down Expand Up @@ -26522,18 +26524,16 @@ interface <dfn>HTMLImageElement</dfn> : <span>HTMLElement</span> {
a simple event</span> named <code title="event-load">load</code>
at the <code>img</code> element.</p>

<p>If at any point the user agent discovers that the image data is
corrupted in some fatal way, or that the image data is not in a
supported file format, then the user agent must set the
<code>img</code> element to the <span
title="img-error">broken</span> state. If the <span
title="fetch">fetching</span> algorithm is still running for this
element, then the user agent must also abort that algorithm,
discarding any pending <span title="concept-task">tasks</span>
generated by that algorithm, and then <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.</p>
<p>Otherwise, either the image data is corrupted in some fatal way
such that the image dimensions cannot be obtained, or the image
data is not in a supported file format; the user agent must set
the <code>img</code> element to the <span
title="img-error">broken</span> state, abort the <span
title="fetch">fetching</span> algorithm, discarding any pending
<span title="concept-task">tasks</span> generated by that
algorithm, and then <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.</p>

</li>

Expand Down

0 comments on commit 8eff91c

Please sign in to comment.