Skip to content

Commit

Permalink
Fix #414: Factor out "use srcset or picture" to avoid grammatical amb…
Browse files Browse the repository at this point in the history
…iguity
  • Loading branch information
zcorpan committed Dec 17, 2015
1 parent 017a842 commit 5fa33f0
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -23846,8 +23846,7 @@ interface <dfn>HTMLImageElement</dfn> : <span>HTMLElement</span> {

<li>

<p>If the element does not have a <code data-x="attr-img-srcset">srcset</code> attribute specified and
it does not have a parent or it has a parent but it is not a <code>picture</code> element,
<p>If the element does not <span>use <code>srcset</code> or <code>picture</code></span>,
and it has a <code data-x="attr-img-src">src</code> attribute specified and
its value is not the empty string, let <var>selected source</var> be the value of the
element's <code data-x="attr-img-src">src</code> attribute, and <var>selected pixel
Expand Down Expand Up @@ -23932,11 +23931,12 @@ interface <dfn>HTMLImageElement</dfn> : <span>HTMLElement</span> {
<span>abort the image request</span> for the <span>current request</span> and the <span>pending request</span>,
and let <span>pending request</span> be null.</p></li>

<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 the empty string,
and then, if the element has a <code data-x="attr-img-src">src</code> attribute
or a <code data-x="attr-img-srcset">srcset</code> attribute
or a parent that is a <code>picture</code> element,
<span>fire a simple event</span> named <code data-x="event-error">error</code> at the <code>img</code> element.</p></li>
<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 the empty string, and then, if the element has a
<code data-x="attr-img-src">src</code> attribute or it <span data-x="use srcset or
picture">uses <code>srcset</code> or <code>picture</code></span>, <span>fire a simple
event</span> named <code data-x="event-error">error</code> at the <code>img</code>
element.</p></li>

<!-- loadstart and loadend do not fire -->

Expand Down Expand Up @@ -23997,8 +23997,8 @@ interface <dfn>HTMLImageElement</dfn> : <span>HTMLElement</span> {
object</span> and <span data-x="concept-request-type">type</span> to "<code
data-x="">image</code>".</p>

<p>&#x231B; If the element has a <code data-x="attr-img-srcset">srcset</code> attribute or a
parent that is a <code>picture</code> element, set <var>request</var>'s <span
<p>&#x231B; If the element <span data-x="use srcset or picture">uses <code>srcset</code> or
<code>picture</code></span>, set <var>request</var>'s <span
data-x="concept-request-initiator">initiator</span> to "<code data-x="">imageset</code>".</p>

<!--FETCH--><p>&#x231B; <span data-x="concept-fetch">Fetch</span> <var>request</var>. Let this
Expand Down Expand Up @@ -24255,6 +24255,10 @@ interface <dfn>HTMLImageElement</dfn> : <span>HTMLElement</span> {
must be a strong reference from the element's <span>node document</span> to the element <var>x</var>,
even if that element is not <span data-x="in a Document">in its <code>Document</code></span>.</p>

<p>An <code>img</code> element is said to <dfn>use <code>srcset</code> or
<code>picture</code></dfn> if it has a <code data-x="attr-img-srcset">srcset</code> attribute
specified or if it has a parent that is a <code>picture</code> element.</p>

<p>When an <code>img</code> element is in the <span data-x="img-all">completely available</span>
state <em>and</em> the user agent can decode the media data without errors, then the
<code>img</code> element is said to be <dfn data-x="img-good">fully decodable</dfn>.</p>
Expand Down Expand Up @@ -24825,13 +24829,10 @@ interface <dfn>HTMLImageElement</dfn> : <span>HTMLElement</span> {
<span>synchronous section</span> has ended. (Steps in <span data-x="synchronous
section">synchronous sections</span> are marked with &#x231B;.)</p></li>

<li><p>&#x231B; If the <code>img</code> element does not have a
<code data-x="attr-img-srcset">srcset</code> attribute specified and
it either has no parent or it is not a <code>picture</code> element,
it is not <span>in a <code>Document</code></span>,
has image data whose resource type is <code>multipart/x-mixed-replace</code>,
or the <span>pending request</span> is not null,
then abort this algorithm.</p></li>
<li><p>&#x231B; If the <code>img</code> element does not <span>use <code>srcset</code> or
<code>picture</code></span>, it is not <span>in a <code>Document</code></span>, has image data
whose resource type is <code>multipart/x-mixed-replace</code>, or the <span>pending
request</span> is not null, then abort this algorithm.</p></li>

<!-- we don't support replacing push-JPEG images because defining what happens with
the tasks and events and so on in that case would become implausibly complicated. -->
Expand Down

0 comments on commit 5fa33f0

Please sign in to comment.