<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>25889</bug_id>
          
          <creation_ts>2014-05-27 06:40:55 +0000</creation_ts>
          <short_desc>&lt;img&gt; When to swap the image for the environment changes case</short_desc>
          <delta_ts>2019-03-29 20:59:44 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#img-determine-type</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>d</cc>
    
    <cc>ian</cc>
    
    <cc>johns</cc>
    
    <cc>mike</cc>
    
    <cc>zcorpan</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>106819</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2014-05-27 06:40:55 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/edits.html
Multipage: http://www.whatwg.org/C#img-determine-type
Complete: http://www.whatwg.org/c#img-determine-type
Referrer: http://www.whatwg.org/specs/web-apps/current-work/multipage/

Comment:
&lt;img&gt; When to swap the image for the environment changes case
&quot;wait for the fetch algorithm to queue its last task&quot; means we wait until the
whole image has been downloaded, then swap.

* Do we want to swap if the image is in a supported format but is broken?
* Do we want to wait until the image has been decoded? (fully or partially?)
* Do we want to swap before the image has been completely downloaded (like
dynamically changing &quot;src&quot; swaps when dimensions are known)?

Posted from: 90.230.218.37 by simonp@opera.com
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.86 Safari/537.36 OPR/22.0.1471.16 (Edition Next)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106952</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-05-28 22:16:19 +0000</bug_when>
    <thetext>IMHO you never want to switch to a broken image if you have a working one. Lower or higher resolution that ideal, or wrong aspect ratio or whatever, is better than nothing. You could swap if you have an incrementally-loading JPEG and you&apos;ve already decoded enough of it that you&apos;re at the resolution that is currently being rendered or better. However, I wouldn&apos;t swap if you just have half a sequentially encoded PNG, say. That would look ugly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108059</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2014-06-19 09:35:22 +0000</bug_when>
    <thetext>Maybe the spec should invoke &quot;update the image data&quot; with a special flag that avoids destroying the image and avoids firing error event, in the environment changes case, instead of having its own algorithm?

Possibly also delay upgrading pending request to current request so that it doesn&apos;t regress image quality while the new image is loading.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108061</commentid>
    <comment_count>3</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2014-06-19 09:50:22 +0000</bug_when>
    <thetext>Maybe for &apos;x&apos; and &apos;w&apos; you want to wait until you have at least the same quality as the old image (if progressive, otherwise wait until completely available), but for art direction you want to swap when you have dimensions.

The spec could leave it up to the UA when to do the swap for the environment changes case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108142</commentid>
    <comment_count>4</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-06-20 21:22:33 +0000</bug_when>
    <thetext>Even for art cases, it&apos;s better to wait til you have enough data to not be more ugly.

Ideally you&apos;d even cross-fade between them, rather than jump cut.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>113178</commentid>
    <comment_count>5</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2014-10-15 08:40:02 +0000</bug_when>
    <thetext>https://github.com/ResponsiveImagesCG/picture-element/commit/c798686911c2bf9334899ac44e0e4a11fa000b19

Leaving open since this might need more tweaks still.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>129690</commentid>
    <comment_count>6</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2019-03-29 20:59:44 +0000</bug_when>
    <thetext>https://github.com/whatwg/html/issues/3709</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>