@@ -25794,9 +25794,11 @@ interface <dfn>HTMLImageElement</dfn> : <span>HTMLElement</span> {
25794
25794
task">queued</span> by the <span>networking task source</span> once the resource has been fetched
25795
25795
has been <span data-x="queue a task">queued</span>.
25796
25796
25797
- <li>The <code>img</code> element is <span data-x="img-all">completely available</span>.
25797
+ <li>The <code>img</code> element's <span>current request</span>'s <span
25798
+ data-x="img-req-state">state</span> is <span data-x="img-all">completely available</span>.
25798
25799
25799
- <li>The <code>img</code> element is <span data-x="img-error">broken</span>.
25800
+ <li>The <code>img</code> element's <span>current request</span>'s <span
25801
+ data-x="img-req-state">state</span> is <span data-x="img-error">broken</span>.
25800
25802
25801
25803
</ul>
25802
25804
@@ -25862,7 +25864,8 @@ img.decode();</pre>
25862
25864
<code>DOMException</code>.</p>
25863
25865
</dd>
25864
25866
25865
- <dt>This <code>img</code> element becomes <span data-x="img-all">completely
25867
+ <dt>This <code>img</code> element's <span>current request</span>'s <span
25868
+ data-x="img-req-state">state</span> becomes <span data-x="img-all">completely
25866
25869
available</span></dt>
25867
25870
25868
25871
<dd>
@@ -26796,21 +26799,21 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...</pre>
26796
26799
26797
26800
<h5 id="images-processing-model">Processing model</h5>
26798
26801
26799
- <p>The <span>task source</span> for the <span data-x="concept-task">tasks</span> <span data-x="queue
26800
- a task">queued</span> by algorithms in this section is the <span>DOM manipulation task
26801
- source</span>.</p>
26802
+ <p>The <span>task source</span> for the <span data-x="concept-task">tasks</span> <span
26803
+ data-x="queue a task">queued</span> by algorithms in this section is the <span>DOM manipulation
26804
+ task source</span>.</p>
26802
26805
26803
26806
<hr>
26804
26807
26805
26808
<p>An <code>img</code> element has a <dfn>current request</dfn> and a <dfn>pending request</dfn>.
26806
26809
The <span>current request</span> is initially set to a new <span>image request</span>.
26807
- The <span>pending request</span> is initially set to null.
26808
- The <span>current request</span> is usually referred to as the <code>img</code> element itself.</p>
26810
+ The <span>pending request</span> is initially set to null.</p>
26809
26811
26810
26812
<p>An <dfn>image request</dfn> has a <dfn data-x="img-req-state">state</dfn>, <dfn
26811
26813
data-x="img-req-url">current URL</dfn>, and <dfn data-x="img-req-data">image data</dfn>.</p>
26812
26814
26813
- <p>An <span>image request</span>'s <span data-x="img-req-state">state</span> is one of the following:</p>
26815
+ <p>An <span>image request</span>'s <span data-x="img-req-state">state</span> is one of the
26816
+ following:</p>
26814
26817
26815
26818
<dl>
26816
26819
@@ -26834,27 +26837,30 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...</pre>
26834
26837
26835
26838
</dl>
26836
26839
26837
- <p>An <span>image request</span>'s <span data-x="img-req-url">current URL</span> is initially the empty string.</p>
26840
+ <p>An <span>image request</span>'s <span data-x="img-req-url">current URL</span> is initially the
26841
+ empty string.</p>
26838
26842
26839
- <p>An <span>image request</span>'s <span data-x="img-req-data">image data</span> is the decoded image data.</p>
26843
+ <p>An <span>image request</span>'s <span data-x="img-req-data">image data</span> is the decoded
26844
+ image data.</p>
26840
26845
26841
26846
<p>When an <span>image request</span>'s <span data-x="img-req-state">state</span> is either <span
26842
26847
data-x="img-inc">partially available</span> or <span data-x="img-all">completely available</span>,
26843
26848
the <span>image request</span> is said to be <dfn data-x="img-available">available</dfn>.</p>
26844
26849
26845
- <p>When an <code>img</code> element is in the <span data-x="img-all">completely available </span>
26846
- state <em>and</em> the user agent can decode the media data without errors, then the
26847
- <code>img</code> element is said to be <dfn data-x="img-good">fully decodable</dfn>.</p>
26848
- <!-- TODO: https://github.com/whatwg/html/issues/3158 (img element state) -- >
26850
+ <p>When an <code>img</code> element's <span>current request </span>'s <span
26851
+ data-x="img-req- state">state</span> is <span data-x="img-all">completely available</span> and the
26852
+ user agent can decode the media data without errors, then the <code>img</code> element is said to
26853
+ be <dfn data-x="img-good">fully decodable</dfn>.</p >
26849
26854
26850
26855
<p>An <span>image request</span>'s <span data-x="img-req-state">state</span> is initially <span
26851
26856
data-x="img-none">unavailable</span>.</p>
26852
26857
26853
- <p>When an <code>img</code> element is <span data-x="img-available">available</span>,
26854
- it provides a <span>paint source</span>
26855
- whose width is the image's <span data-x="density-corrected intrinsic width and height">density-corrected intrinsic width</span> (if any),
26856
- whose height is the image's <span data-x="density-corrected intrinsic width and height">density-corrected intrinsic height</span> (if any),
26857
- and whose appearance is the intrinsic appearance of the image.</p>
26858
+ <p>When an <code>img</code> element's <span>current request</span> is <span
26859
+ data-x="img-available">available</span>, the <code>img</code> element provides a <span>paint
26860
+ source</span> whose width is the image's <span data-x="density-corrected intrinsic width and
26861
+ height">density-corrected intrinsic width</span> (if any), whose height is the image's <span
26862
+ data-x="density-corrected intrinsic width and height">density-corrected intrinsic height</span>
26863
+ (if any), and whose appearance is the intrinsic appearance of the image.</p>
26858
26864
26859
26865
<hr>
26860
26866
@@ -26938,12 +26944,12 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...</pre>
26938
26944
whenever that element is created or has experienced <span>relevant mutations</span>.</p>
26939
26945
26940
26946
<p>A user agent that obtains images on demand must <span>update the image data</span> of an
26941
- <code>img</code> element whenever it needs the image data (i.e. on demand),
26942
- but only if the <code>img</code> element is in the
26943
- < span data-x="img-none">unavailable</span> state . When an <code>img</code> element
26944
- has experienced <span>relevant mutations</span>, if the user
26945
- agent only obtains images on demand, the <code>img</code> element must return to the <span
26946
- data-x="img-none">unavailable</span> state .</p>
26947
+ <code>img</code> element whenever it needs the image data (i.e., on demand), but only if the
26948
+ <code>img</code> element's <span>current request</span>'s <span
26949
+ data-x="img-req-state">state</ span> is <span data-x="img-none">unavailable</span>. When an
26950
+ <code>img</code> element has experienced <span>relevant mutations</span>, if the user agent only
26951
+ obtains images on demand, the <code>img</code> element's <span>current request</span>'s <span
26952
+ data-x="img-req-state">state</span> must return to <span data-x="img- none">unavailable</span>.</p>
26947
26953
26948
26954
26949
26955
<h6>Reacting to DOM mutations</h6>
@@ -27314,11 +27320,12 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...</pre>
27314
27320
task">queued</span> by the <span>networking task source</span> while the image is being
27315
27321
fetched must update the presentation of the image, but as each new body part comes in, it must
27316
27322
replace the previous image. Once one body part has been completely decoded, the user agent
27317
- must set the <code>img</code> element to the <span data-x="img-all">completely
27318
- available</span> state and <span>queue a task</span> to <span data-x="concept-event-fire">fire
27319
- an event</span> named <code data-x="event-load">load</code> at the <code>img</code>
27320
- element.</p>
27321
- <!--TODO what if the image is broken? -->
27323
+ must set the <code>img</code> element's <span>current request</span>'s <span
27324
+ data-x="img-req-state">state</span> to <span data-x="img-all">completely available</span> and
27325
+ <span>queue a task</span> to <span data-x="concept-event-fire">fire an event</span> named
27326
+ <code data-x="event-load">load</code> at the <code>img</code> element.</p>
27327
+ <!--TODO what if the image is broken?
27328
+ TODO change state and fire in the same task? -->
27322
27329
27323
27330
<p class="note">The <code data-x="event-progress">progress</code> and <code
27324
27331
data-x="event-loadend">loadend</code> events are not fired for
@@ -62230,9 +62237,10 @@ try {
62230
62237
62231
62238
<ol>
62232
62239
62233
- <li><p>If <var>image</var> is an <code>HTMLOrSVGImageElement</code> object that is in the <span
62234
- data-x="img-error">broken</span> state, then throw an
62235
- <span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p></li>
62240
+ <li><p>If <var>image</var> is an <code>HTMLOrSVGImageElement</code> object whose <span>current
62241
+ request</span>'s <span data-x="img-req-state">state</span> is <span
62242
+ data-x="img-error">broken</span>, then throw an <span>"<code>InvalidStateError</code>"</span>
62243
+ <code>DOMException</code>.</p></li>
62236
62244
62237
62245
<li><p>If <var>image</var> is an <code>HTMLOrSVGImageElement</code> object that is not <span
62238
62246
data-x="img-good">fully decodable</span>, or if <var>image</var> is an
@@ -92717,8 +92725,8 @@ dictionary <dfn>ImageBitmapOptions</dfn> {
92717
92725
<li><p>If either the <var>sw</var> or <var>sh</var> arguments are specified but zero, return a
92718
92726
promise rejected with a <code data-x="js-RangeError">RangeError</code>.</p></li>
92719
92727
92720
- <li><p>If <var>image</var> is not <span data-x="img-all">completely available </span>, then
92721
- return a promise rejected with an <span>"<code>InvalidStateError</code>"</span>
92728
+ <li><p>If <var>image</var> is not <span data-x="img-good">fully decodeable </span>, then return
92729
+ a promise rejected with an <span>"<code>InvalidStateError</code>"</span>
92722
92730
<code>DOMException</code>.</p></li>
92723
92731
92724
92732
<li><p>If <var>image</var>'s media data has no <span>intrinsic dimensions</span> (e.g. it's a
0 commit comments