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

Make <img>.complete more reliable #4934

Merged
merged 2 commits into from
Oct 15, 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
18 changes: 4 additions & 14 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -26519,7 +26519,6 @@ interface <dfn>HTMLImageElement</dfn> : <span>HTMLElement</span> {
any of the following conditions is true:</p>

<ul class="brief">

<!--TODO: check picture parent-->

<li>Both the <code data-x="attr-img-src">src</code> attribute and the <code
Expand All @@ -26530,23 +26529,17 @@ interface <dfn>HTMLImageElement</dfn> : <span>HTMLElement</span> {
hack for src="", not srcset=""; present but empty or bogus srcset="" still means complete=false
if it's not in the img-error state -->

<li>The final <span data-x="concept-task">task</span> that is <span data-x="queue a
task">queued</span> by the <span>networking task source</span> once the resource has been fetched
has been <span data-x="queue a task">queued</span>.

<li>The <code>img</code> element's <span>current request</span>'s <span
data-x="img-req-state">state</span> is <span data-x="img-all">completely available</span>.
data-x="img-req-state">state</span> is <span data-x="img-all">completely available</span> and its
<span>pending request</span> is null.

<li>The <code>img</code> element's <span>current request</span>'s <span
data-x="img-req-state">state</span> is <span data-x="img-error">broken</span>.

data-x="img-req-state">state</span> is <span data-x="img-error">broken</span> and its
<span>pending request</span> is null.
</ul>

<p>Otherwise, the attribute must return false.</p>

<p class="note">The value of <code data-x="dom-img-complete">complete</code> can thus change while
a <span data-x="concept-script">script</span> is executing.</p>

<p>The <dfn data-x="dom-img-currentSrc"><code>currentSrc</code></dfn> IDL attribute
must return the <code>img</code> element's <span>current request</span>'s <span data-x="img-req-url">current URL</span>.</p>

Expand All @@ -26571,9 +26564,6 @@ img.decode();</code></pre>
</div>

<ol>
<!-- TODO: much of this could be phrased entirely in terms of the current request if
https://github.com/whatwg/html/issues/1055 gets fixed. See
https://github.com/whatwg/html/pull/2332#issuecomment-278613713 -->
<li>
<p>If any of the following conditions are true about this <code>img</code> element:</p>

annevk marked this conversation as resolved.
Show resolved Hide resolved
Expand Down