<?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>192147</bug_id>
          
          <creation_ts>2018-11-29 06:37:56 -0800</creation_ts>
          <short_desc>Multiple Picture Sources Downloading width media-query</short_desc>
          <delta_ts>2026-03-30 01:01:04 -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 12</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>macOS 10.13</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <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="Yvain Liechti">ryuran</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>colin</cc>
    
    <cc>koivisto</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>yoav</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1482926</commentid>
    <comment_count>0</comment_count>
      <attachid>356003</attachid>
    <who name="Yvain Liechti">ryuran</who>
    <bug_when>2018-11-29 06:37:56 -0800</bug_when>
    <thetext>Created attachment 356003
html file for test

Maybe related to #159484

When the html file join to this ticket is loaded in a small viewport (400px for example), any image from first &lt;source&gt; should not be loaded.

Currently on 400px wide viewport `https://dummyimage.com/512x450/100` (`https://dummyimage.com/1024x900/300` on retina screen) is loaded uselessly in addition to the one needed (`https://dummyimage.com/640x900/030` or `https://dummyimage.com/1280x1800/060` for retina screen).

```
    &lt;picture&gt;
        &lt;source media=&quot;(min-width: 40rem)&quot; srcset=&quot;
                https://dummyimage.com/256x225/100 256w,
                https://dummyimage.com/512x450/100 512w,
                https://dummyimage.com/1024x900/300 1024w,
                https://dummyimage.com/2048x1800/600 2048w,
                https://dummyimage.com/4096x3600/900 4096w&quot; sizes=&quot;100vw&quot;&gt;
        &lt;img src=&quot;https://dummyimage.com/640x900/006&quot; srcset=&quot;
                https://dummyimage.com/640x900/030 640w,
                https://dummyimage.com/1280x1800/060 1280w&quot; sizes=&quot;100vw&quot; alt=&quot;&quot;&gt;
    &lt;/picture&gt;
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1482956</commentid>
    <comment_count>1</comment_count>
    <who name="Colin Bendell">colin</who>
    <bug_when>2018-11-29 08:28:33 -0800</bug_when>
    <thetext>Looks like a preloader problem with media queries using `rem` or `em`. If the mq uses absolute `px` this problem does not appear.

* First mq is always selected when only relative units are available, adjusted later by the loader (2nd request)
* First mq with absolute unites will be selected, adjusted later by the loader</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1483042</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-11-29 11:01:28 -0800</bug_when>
    <thetext>&lt;rdar://problem/46347476&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>356003</attachid>
            <date>2018-11-29 06:37:56 -0800</date>
            <delta_ts>2018-11-29 06:37:56 -0800</delta_ts>
            <desc>html file for test</desc>
            <filename>index.html</filename>
            <type>text/html</type>
            <size>1621</size>
            <attacher name="Yvain Liechti">ryuran</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sIGxhbmc9ImVuIj4KPGhlYWQ+CiAgICA8bWV0YSBjaGFyc2V0
PSJVVEYtOCI+CiAgICA8bWV0YSBuYW1lPSJ2aWV3cG9ydCIgY29udG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gICAg
ICAgICAgaHR0cHM6Ly9kdW1teWltYWdlLmNvbS80MDk2eDM2MDAvOTAwIDQwOTZ3IgogICAgICAg
ICAgICBzaXplcz0iMTAwdnciCiAgICAgICAgLz4KICAgICAgICA8aW1nCiAgICAgICAgICAgIHNy
Yz0iaHR0cHM6Ly9kdW1teWltYWdlLmNvbS82NDB4OTAwLzAwNiIKICAgICAgICAgICAgc3Jjc2V0
PSIKICAgICAgICAgICAgICAgIGh0dHBzOi8vZHVtbXlpbWFnZS5jb20vNjQweDkwMC8wMzAgNjQw
dywKICAgICAgICAgICAgICAgIGh0dHBzOi8vZHVtbXlpbWFnZS5jb20vMTI4MHgxODAwLzA2MCAx
MjgwdyIKICAgICAgICAgICAgc2l6ZXM9IjEwMHZ3IgogICAgICAgICAgICBhbHQ9IiIKICAgICAg
ICAvPgogICAgPC9waWN0dXJlPgogICAgPHA+Q3VycmVudGx5IG9uIDQwMHB4IHdpZGUgdmlld3Bv
cnQgPGNvZGU+aHR0cHM6Ly9kdW1teWltYWdlLmNvbS81MTJ4NDUwLzEwMDwvY29kZT4gKDxjb2Rl
Pmh0dHBzOi8vZHVtbXlpbWFnZS5jb20vMTAyNHg5MDAvMzAwPC9jb2RlPiBvbiByZXRpbmEgc2Ny
ZWVuKSBpcyBsb2FkZWQgdXNlbGVzc2x5IGluIGFkZGl0aW9uIHRvIHRoZSBvbmUgbmVlZGVkICg8
Y29kZT5odHRwczovL2R1bW15aW1hZ2UuY29tLzY0MHg5MDAvMDMwPC9jb2RlPiBvciA8Y29kZT5o
dHRwczovL2R1bW15aW1hZ2UuY29tLzEyODB4MTgwMC8wNjA8L2NvZGU+IGZvciByZXRpbmEgc2Ny
ZWVuKS48L3A+CjwvYm9keT4KPC9odG1sPg==
</data>

          </attachment>
      

    </bug>

</bugzilla>