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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>249113</bug_id>
          
          <creation_ts>2022-12-11 15:25:53 -0800</creation_ts>
          <short_desc>Progressive Images (e.g., JPEG) should render while loading</short_desc>
          <delta_ts>2025-01-11 13:07:43 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Images</component>
          <version>Safari Technology Preview</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=272350</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ahmad Saleem">ahmad.saleem792</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>don.olmstead</cc>
    
    <cc>fujii</cc>
    
    <cc>mateusz.karpow</cc>
    
    <cc>mattwoodrow</cc>
    
    <cc>mmaxfield</cc>
    
    <cc>nekohayo</cc>
    
    <cc>rego</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1918348</commentid>
    <comment_count>0</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-12-11 15:25:53 -0800</bug_when>
    <thetext>Hi Team,

While going through Blink&apos;s commit, it seems that Webkit wait for image to be loaded rather than loading it progressively.

Failing Test Case - https://jsfiddle.net/6y4zjb17/

Safari 16.1 will take ages to load image while Chrome will load it progressively.

Blink Commit - https://src.chromium.org/viewvc/blink?view=revision&amp;revision=198593

Webkit GitHub Source - https://github.com/WebKit/WebKit/blob/bf6ec0b71883ada1ee6d8d0c66a8ea7e421c5e27/Source/WebCore/rendering/RenderLayerBacking.cpp#LL3109

Just wanted to raise this bug so this can be fixed.

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1919003</commentid>
    <comment_count>1</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-12-13 17:09:00 -0800</bug_when>
    <thetext>After discussion with Simon on Slack, it is needed because partially loaded images should not go to Core Animation on Cocoa platforms.

There might be strategic fix in future to get rid of this but Simon mentioned that it is still valuable to keep this open for future tracking purposes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1920388</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-12-18 15:26:16 -0800</bug_when>
    <thetext>&lt;rdar://problem/103499397&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1941372</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-03-14 15:45:49 -0700</bug_when>
    <thetext>I think adding #if PLATFORM(COCOA) etc. around this will fix it for WinCairo, WPE and GTK platforms, which does not use &apos;Core Animation&apos; and make progressive JPEG loading for those platforms better.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1964207</commentid>
    <comment_count>4</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-06-29 02:20:26 -0700</bug_when>
    <thetext>(In reply to Ahmad Saleem from comment #3)
&gt; I think adding #if PLATFORM(COCOA) etc. around this will fix it for
&gt; WinCairo, WPE and GTK platforms, which does not use &apos;Core Animation&apos; and
&gt; make progressive JPEG loading for those platforms better.

I think adding:


#if !PLATFORM(WPE) &amp;&amp; !PLATFORM(GTK) &amp;&amp; !PLATFORM(WIN)
// We have to wait until the image is fully loaded before setting it on the layer.
if (!cachedImage-&gt;isLoaded())
    return;
#endif

would make it at least work for other platform and they will get better performance. I am happy to do patch but it wouldn&apos;t have test case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1976224</commentid>
    <comment_count>5</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-09-07 14:21:59 -0700</bug_when>
    <thetext>Closing my PR: https://github.com/WebKit/WebKit/pull/15503

Tried to add flags but need input from Simon or someone from Apple team with knowledge of where we use this settings, so we can only allow it on those rather than other way around to disable on non-apple ports.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2000306</commentid>
    <comment_count>6</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-12-17 14:30:45 -0800</bug_when>
    <thetext>Test URL - http://home.mcom.com/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2048013</commentid>
    <comment_count>7</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-07-24 06:46:17 -0700</bug_when>
    <thetext>SVN link is gone so reference - https://github.com/chromium/chromium/commit/4c296462f985890e24a2a552f6c6da54a2010ea9</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>