<?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>149899</bug_id>
          
          <creation_ts>2015-10-07 14:46:22 -0700</creation_ts>
          <short_desc>Responsive images (srcset, sizes, w) don&apos;t load higher resolution when viewport is enlarged.</short_desc>
          <delta_ts>2026-03-30 01:00:33 -0700</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 9</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.11</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=245656</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Duncan Wilcox">duncan</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bdakin</cc>
    
    <cc>dev</cc>
    
    <cc>dino</cc>
    
    <cc>eoconnor</cc>
    
    <cc>moritz.mahringer</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>thorton</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>yoav</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1131434</commentid>
    <comment_count>0</comment_count>
      <attachid>262646</attachid>
    <who name="Duncan Wilcox">duncan</who>
    <bug_when>2015-10-07 14:46:22 -0700</bug_when>
    <thetext>Created attachment 262646
testcase

The attached test case defines a 100% size image. The srcset attribute indicates different resolution images to be loaded. The sizes attribute indicates the image is going to be 100% of the viewport size.

The test case file should be opened after the browser window has been made as narrow as possible, or reloading the page after having made the browser window as narrow as possible. This ensures the browser starts with the smallest size image it needs. The placeholder images (sourced from placehold.it) show the image size. The initial image is typically 800 pixels on a retina Mac, with the Safari window as narrow as possible, as indicated by the &quot;800w&quot; text in the image.

The expected behavior is for the image to be reloaded when the viewport size changes, so making the browser window wider should show a new text, such as 1000w or 1200w, and so on.

The actual behavior in Safari 9 is no new image is ever loaded, until the whole page is reloaded. The current version of Chrome (45....) properly loads larger images.

While this is under- or un-specified in the relevant spec (https://html.spec.whatwg.org/multipage/embedded-content.html) the sensible approach is to load proper assets for the current viewport. Otherwise images will appear fuzzy or pixellated. On the desktop the switch can be dramatic (perhaps 400 to 1200+), but even on mobile a portrait/landscape rotation can almost double the required image size, and a split screen 320 pixel wide mobile safari can become a 1000+ pixel wide full screen browser.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1131560</commentid>
    <comment_count>1</comment_count>
    <who name="Yoav Weiss">yoav</who>
    <bug_when>2015-10-08 00:20:58 -0700</bug_when>
    <thetext>Switching resources when the viewport changes have not yet been implemented.

This behavior is not specified on purpose, leaving UAs to do what they see fit, which means that current behavior is spec compliant. With that said, I believe we should implement such dynamic loading, for the reasons you stated.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1645005</commentid>
    <comment_count>2</comment_count>
    <who name="Moritz Mahringer">moritz.mahringer</who>
    <bug_when>2020-04-23 16:39:18 -0700</bug_when>
    <thetext>This is still a problem.
We have to add an event listener to manually change the srcSet attribute to make it reevaluate. Chrome correctly automatically updates to a larger size on resize.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1645216</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-04-24 09:25:59 -0700</bug_when>
    <thetext>&lt;rdar://problem/62318091&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>262646</attachid>
            <date>2015-10-07 14:46:22 -0700</date>
            <delta_ts>2015-10-07 14:46:22 -0700</delta_ts>
            <desc>testcase</desc>
            <filename>srcset2.html</filename>
            <type>text/html</type>
            <size>645</size>
            <attacher name="Duncan Wilcox">duncan</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KICA8bWV0YSBjaGFyc2V0PSJ1dGYtOCI+CiAg
PHRpdGxlPnNyY3NldCB0ZXN0IDI8L3RpdGxlPgo8c3R5bGU+CmltZyB7IHdpZHRoOiAxMDAlOyB9
Cjwvc3R5bGU+CjwvaGVhZD4KPGJvZHk+CiAgPGltZyBzcmM9Imh0dHA6Ly9wbGFjZWhvbGQuaXQv
MjAwP3RleHQ9ZmFsbGJhY2siCglzcmNzZXQ9Imh0dHA6Ly9wbGFjZWhvbGQuaXQvMTAwP3RleHQ9
MTAwdyAxMDB3LCBodHRwOi8vcGxhY2Vob2xkLml0LzIwMD90ZXh0PTIwMHcgMjAwdywgaHR0cDov
L3BsYWNlaG9sZC5pdC80MDA/dGV4dD00MDB3IDQwMHcsIGh0dHA6Ly9wbGFjZWhvbGQuaXQvNjAw
P3RleHQ9NjAwdyA2MDB3LCBodHRwOi8vcGxhY2Vob2xkLml0LzgwMD90ZXh0PTgwMHcgODAwdywg
aHR0cDovL3BsYWNlaG9sZC5pdC8xMDAwP3RleHQ9MTAwMHcgMTAwMHcsIGh0dHA6Ly9wbGFjZWhv
bGQuaXQvMTIwMD90ZXh0PTEyMDB3IDEyMDB3LCBodHRwOi8vcGxhY2Vob2xkLml0LzE0MDA/dGV4
dD0xNDAwdyAxNDAwdywgaHR0cDovL3BsYWNlaG9sZC5pdC8xNjAwP3RleHQ9MTYwMHcgMTYwMHcs
IGh0dHA6Ly9wbGFjZWhvbGQuaXQvMTgwMD90ZXh0PTE4MDB3IDE4MDB3IiBzaXplcz0iMTAwdnci
Pgo8L2JvZHk+CjwvaHRtbD4K
</data>

          </attachment>
      

    </bug>

</bugzilla>