Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove <img> progress events #4842

Merged
merged 3 commits into from
Aug 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 13 additions & 82 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -3437,7 +3437,6 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<li><dfn data-x="dom-ProgressEvent-lengthComputable" data-x-href="https://xhr.spec.whatwg.org/#dom-progressevent-lengthcomputable"><code>ProgressEvent.lengthComputable</code></dfn> attribute</li>
<li><dfn data-x="dom-ProgressEvent-loaded" data-x-href="https://xhr.spec.whatwg.org/#dom-progressevent-loaded"><code>ProgressEvent.loaded</code></dfn> attribute</li>
<li><dfn data-x="dom-ProgressEvent-total" data-x-href="https://xhr.spec.whatwg.org/#dom-progressevent-total"><code>ProgressEvent.total</code></dfn> attribute</li>
<li><dfn data-x="fire a progress event" data-x-href="https://xhr.spec.whatwg.org/#concept-event-fire-progress">Fire a progress event named <var>e</var></dfn></li>
<li><dfn data-x-href="https://xhr.spec.whatwg.org/#formdata"><code>FormData</code></dfn>
interface</li>
<li><dfn data-x-href="https://xhr.spec.whatwg.org/#formdataentryvalue"><code>FormDataEntryValue</code></dfn>
Expand Down Expand Up @@ -11678,7 +11677,6 @@ https://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%
<li><code data-x="handler-onload">onload</code>*</li>
<li><code data-x="handler-onloadeddata">onloadeddata</code></li>
<li><code data-x="handler-onloadedmetadata">onloadedmetadata</code></li>
<li><code data-x="handler-onloadend">onloadend</code></li>
<li><code data-x="handler-onloadstart">onloadstart</code></li>
<li><code data-x="handler-onmousedown">onmousedown</code></li>
<li><code data-x="handler-onmouseenter">onmouseenter</code></li>
Expand Down Expand Up @@ -27876,11 +27874,6 @@ was an English &lt;a href="/wiki/Music_hall">music hall&lt;/a> singer, ...</code
<li><p>Abort the <span>update the image data</span> algorithm.</p></li>
</ol>
</li>

<!--
load is an event here
loadstart and loadend do not fire
-->
</ol>
</li>

Expand Down Expand Up @@ -27920,15 +27913,11 @@ was an English &lt;a href="/wiki/Music_hall">music hall&lt;/a> singer, ...</code
picture">uses <code>srcset</code> or <code>picture</code></span>, <span
data-x="concept-event-fire">fire an event</span> named <code data-x="event-error">error</code>
at the <code>img</code> element.</p></li>
<!-- loadstart and loadend do not fire -->

<li><p>&#x231B; Return.</p></li>
</ol>
</li>

<li><p>&#x231B; <span>Queue a task</span> to <span>fire a progress event</span> named <code
data-x="event-loadstart">loadstart</code> at the <code>img</code> element.</p></li>

<li>
<p>&#x231B; <span data-x="parse a url">Parse</span> <var>selected source</var>, relative to the
element's <span>node document</span>, and let <var>urlString</var> be the <span>resulting URL
Expand All @@ -27946,8 +27935,7 @@ was an English &lt;a href="/wiki/Music_hall">music hall&lt;/a> singer, ...</code
<li><p>&#x231B; <span>Queue a task</span> to change the <span>current request</span>'s <span
data-x="img-req-url">current URL</span> to <var>selected source</var>, <span
data-x="concept-event-fire">fire an event</span> named <code data-x="event-error">error</code>
at the <code>img</code> element and then <span data-x="concept-event-fire">fire an event</span>
named <code data-x="event-loadend">loadend</code> at the <code>img</code> element.</p></li>
at the <code>img</code> element.</p></li>

<li><p>&#x231B; Return.</p></li>
</ol>
Expand Down Expand Up @@ -28015,12 +28003,6 @@ was an English &lt;a href="/wiki/Music_hall">music hall&lt;/a> singer, ...</code
data-x="origin">cross-origin</span> access control policies that are stricter than those
described above to mitigate this attack, but unfortunately such policies are typically not
compatible with existing Web content.</p>

<p>If the resource is <span>CORS-same-origin</span>, each <span data-x="concept-task">task</span>
that is <span data-x="queue a task">queued</span> by the <span>networking task source</span>
while the image is being fetched, if <var>image request</var> is the <span>current
request</span>, must <span>fire a progress event</span> named <code
data-x="event-progress">progress</code> at the <code>img</code> element.</p>
</li>

<li><p>End the <span>synchronous section</span>, continuing the remaining steps <span>in
Expand Down Expand Up @@ -28085,11 +28067,6 @@ was an English &lt;a href="/wiki/Music_hall">music hall&lt;/a> singer, ...</code
<code data-x="event-load">load</code> at the <code>img</code> element.</p>
<!--TODO what if the image is broken?
TODO change state and fire in the same task? -->

<p class="note">The <code data-x="event-progress">progress</code> and <code
data-x="event-loadend">loadend</code> events are not fired for
<code>multipart/x-mixed-replace</code> image streams.</p>

</dd>

<dt>If the resource type and data corresponds to a supported image format, <a
Expand Down Expand Up @@ -28119,23 +28096,15 @@ was an English &lt;a href="/wiki/Music_hall">music hall&lt;/a> singer, ...</code
request</span> for the <span>current request</span> and the <span>pending request</span>,
<span>upgrade the pending request to the current request</span>, set <span>current
request</span>'s <span data-x="img-req-state">state</span> to <span
data-x="img-error">broken</span>, <span data-x="concept-event-fire">fire an event</span>
named <code data-x="event-error">error</code> at the <code>img</code> element, <span
data-x="concept-event-fire">fire an event</span> named <code
data-x="event-loadend">loadend</code> at the <code>img</code> element.</p></li>

<li>

<p>Otherwise, if the user agent is able to determine that <var>image request</var>'s image
is corrupted in some fatal way such that the image dimensions cannot be obtained, and
<var>image request</var> is <span>current request</span>, <span>abort the image
request</span> for <var>image request</var>, <span data-x="concept-event-fire">fire an
event</span> named <code data-x="event-error">error</code> at the <code>img</code> element,
<span data-x="concept-event-fire">fire an event</span> named <code
data-x="event-loadend">loadend</code> at the <code>img</code> element.</p>

</li>
data-x="img-error">broken</span>, and <span data-x="concept-event-fire">fire an event</span>
named <code data-x="event-error">error</code> at the <code>img</code> element.</p></li>

<li><p>Otherwise, if the user agent is able to determine that <var>image request</var>'s
image is corrupted in some fatal way such that the image dimensions cannot be obtained, and
<var>image request</var> is <span>current request</span>, <span>abort the image
request</span> for <var>image request</var> and <span data-x="concept-event-fire">fire an
event</span> named <code data-x="event-error">error</code> at the <code>img</code>
element.</p></li>
</ol>

<p id="img-load">That <span data-x="concept-task">task</span>, and each subsequent <span
Expand Down Expand Up @@ -28168,14 +28137,9 @@ was an English &lt;a href="/wiki/Music_hall">music hall&lt;/a> singer, ...</code

<li><p>Add the image to the <span>list of available images</span> using the key <var>key</var>, with the <span>ignore higher-layer caching</span> flag set.</p></li>

<li><p><span>Fire a progress event or event</span> named <code data-x="event-load">load</code>
at the <code>img</code> element, depending on the resource in <var>image request</var>.</p></li>

<li><p><span>Fire a progress event or event</span> named <code data-x="event-loadend">loadend</code>
at the <code>img</code> element, depending on the resource in <var>image request</var>.</p></li>

<li><p><span data-x="concept-event-fire">Fire an event</span> named <code
data-x="event-load">load</code> at the <code>img</code> element.</p></li>
</ol>

</dd>

<dt>Otherwise</dt>
Expand All @@ -28185,10 +28149,8 @@ was an English &lt;a href="/wiki/Music_hall">music hall&lt;/a> singer, ...</code
data-x="img-error">broken</span>, <span>abort the image request</span> for the <span>current
request</span> and the <span>pending request</span>, <span>upgrade the pending request to the
current request</span> if <var>image request</var> is the <span>pending request</span>, and
then <span>queue a task</span> to first <span data-x="concept-event-fire">fire an event</span>
named <code data-x="event-error">error</code> at the <code>img</code> element and then <span
data-x="concept-event-fire">fire an event</span> named <code
data-x="event-loadend">loadend</code> at the <code>img</code> element.</p></dd>
then <span>queue a task</span> to <span data-x="concept-event-fire">fire an event</span> named
<code data-x="event-error">error</code> at the <code>img</code> element.</p></dd>
</dl>
</li>
</ol>
Expand Down Expand Up @@ -28218,11 +28180,6 @@ was an English &lt;a href="/wiki/Music_hall">music hall&lt;/a> singer, ...</code

</ol>

<p>To <dfn>fire a progress event or event</dfn> named <var>type</var> at an element <var>e</var>,
depending on resource <var>r</var>, means to <span>fire a progress event</span> named
<var>type</var> at <var>e</var> if <var>r</var> is <span>CORS-same-origin</span>, and otherwise
<span data-x="concept-event-fire">fire an event</span> named <var>type</var> at <var>e</var>.</p>


<h6>Selecting an image source</h6>

Expand Down Expand Up @@ -92681,7 +92638,6 @@ typedef <span>OnBeforeUnloadEventHandlerNonNull</span>? <dfn>OnBeforeUnloadEvent
<tr><td><dfn data-export="" data-dfn-type="attribute" data-dfn-for="HTMLElement,Document,Window,GlobalEventHandlers"><code data-x="handler-onkeyup">onkeyup</code></dfn> <td> <code data-x="event-keyup">keyup</code> <!-- widely used -->
<tr><td><dfn data-export="" data-dfn-type="attribute" data-dfn-for="HTMLElement,Document,Window,GlobalEventHandlers"><code data-x="handler-onloadeddata">onloadeddata</code></dfn> <td> <code data-x="event-media-loadeddata">loadeddata</code>
<tr><td><dfn data-export="" data-dfn-type="attribute" data-dfn-for="HTMLElement,Document,Window,GlobalEventHandlers"><code data-x="handler-onloadedmetadata">onloadedmetadata</code></dfn> <td> <code data-x="event-media-loadedmetadata">loadedmetadata</code>
<tr><td><dfn data-export="" data-dfn-type="attribute" data-dfn-for="HTMLElement,Document,Window,GlobalEventHandlers"><code data-x="handler-onloadend">onloadend</code></dfn> <td> <code data-x="event-loadend">loadend</code>
<tr><td><dfn data-export="" data-dfn-type="attribute" data-dfn-for="HTMLElement,Document,Window,GlobalEventHandlers"><code data-x="handler-onloadstart">onloadstart</code></dfn> <td> <code data-x="event-media-loadstart">loadstart</code>
<tr><td><dfn data-export="" data-dfn-type="attribute" data-dfn-for="HTMLElement,Document,Window,GlobalEventHandlers"><code data-x="handler-onmousedown">onmousedown</code></dfn> <td> <code data-x="event-mousedown">mousedown</code> <!-- widely used -->
<tr><td><dfn data-export="" data-dfn-type="attribute" data-dfn-for="HTMLElement,Document,Window,GlobalEventHandlers"><code data-x="handler-onmouseenter">onmouseenter</code></dfn> <td> <code data-x="event-mouseenter">mouseenter</code> <!-- compat -->
Expand Down Expand Up @@ -92863,7 +92819,6 @@ typedef <span>OnBeforeUnloadEventHandlerNonNull</span>? <dfn>OnBeforeUnloadEvent
attribute <span>EventHandler</span> <span data-x="handler-onload">onload</span>;
attribute <span>EventHandler</span> <span data-x="handler-onloadeddata">onloadeddata</span>;
attribute <span>EventHandler</span> <span data-x="handler-onloadedmetadata">onloadedmetadata</span>;
attribute <span>EventHandler</span> <span data-x="handler-onloadend">onloadend</span>;
attribute <span>EventHandler</span> <span data-x="handler-onloadstart">onloadstart</span>;
attribute <span>EventHandler</span> <span data-x="handler-onmousedown">onmousedown</span>;
[LenientThis] attribute <span>EventHandler</span> <span data-x="handler-onmouseenter">onmouseenter</span>;
Expand Down Expand Up @@ -121939,12 +121894,6 @@ interface <dfn>External</dfn> {
<td> <code data-x="event-media-loadedmetadata">loadedmetadata</code> event handler
<td> <span data-x="event handler content attributes">Event handler content attribute</span>

<tr>
<th id="ix-handler-onloadend"> <code data-x="">onloadend</code>
<td> <span data-x="handler-onloadend">HTML elements</span>
<td> <code data-x="event-loadend">loadend</code> event handler
<td> <span data-x="event handler content attributes">Event handler content attribute</span>

<tr>
<th id="ix-handler-onloadstart"> <code data-x="">onloadstart</code>
<td> <span data-x="handler-onloadstart">HTML elements</span>
Expand Down Expand Up @@ -122808,18 +122757,6 @@ INSERT INTERFACES HERE
<td> <code>Window</code>, elements
<td> Fired at the <code>Window</code> when the document has finished loading; fired at an element containing a resource (e.g. <code>img</code>, <code>embed</code>) when its resource has finished loading

<tr> <!-- loadend -->
<td> <dfn data-dfn-type="event" data-dfn-for="HTMLElement" data-export=""><code data-x="event-loadend">loadend</code></dfn>
<td> <code>Event</code> or <code>ProgressEvent</code>
<td> <code>img</code> elements
<td> Fired at <code>img</code> elements after a successful load

<tr> <!-- loadstart -->
<td> <dfn data-dfn-type="event" data-dfn-for="HTMLElement" data-export=""><code data-x="event-loadstart">loadstart</code></dfn>
<td> <code>ProgressEvent</code>
<td> <code>img</code> elements
<td> Fired at <code>img</code> elements when a load begins (see also <span data-x="event-media-loadstart">media element events</span>)

<tr> <!-- message -->
<td> <dfn data-dfn-type="event" data-dfn-for="Window,EventSource,WebSocket,MessagePort,BroadcastChannel,DedicatedWorkerGlobalScope,Worker,ServiceWorkerContainer" data-export=""><code data-x="event-message">message</code></dfn>
<td> <code>MessageEvent</code>
Expand Down Expand Up @@ -122875,12 +122812,6 @@ INSERT INTERFACES HERE
<td> <code>Window</code>
<td> Fired at the <code>Window</code> when the user navigates the <span>session history</span>

<tr> <!-- progress -->
<td> <dfn data-dfn-type="event" data-dfn-for="HTMLElement" data-export=""><code data-x="event-progress">progress</code></dfn>
<td> <code>ProgressEvent</code>
<td> <code>img</code> elements
<td> Fired at <code>img</code> elements during a <span>CORS-same-origin</span> image load (see also <span data-x="event-media-progress">media element events</span>)

<tr> <!-- readystatechange -->
<td> <dfn data-dfn-type="event" data-dfn-for="Document" data-export=""><code data-x="event-readystatechange">readystatechange</code></dfn>
<td> <code>Event</code>
Expand Down