<?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>281998</bug_id>
          
          <creation_ts>2024-10-23 11:57:00 -0700</creation_ts>
          <short_desc>Image incorrectly loads even when set to lazy loading.</short_desc>
          <delta_ts>2025-04-21 16:55:07 -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>WebKit Nightly Build</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=291793</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="Emilio Cobos Álvarez (:emilio)">emilio</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cdumez</cc>
    
    <cc>karlcow</cc>
    
    <cc>rbuis</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2070169</commentid>
    <comment_count>0</comment_count>
      <attachid>473021</attachid>
    <who name="Emilio Cobos Álvarez (:emilio)">emilio</who>
    <bug_when>2024-10-23 11:57:00 -0700</bug_when>
    <thetext>Created attachment 473021
Testcase

See test-case. When src is set on a disconnected image, the image seems to get loaded synchronously even though when loading=lazy is set

Note chrome has a similar bug: https://issues.chromium.org/issues/375209498</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2070170</commentid>
    <comment_count>1</comment_count>
    <who name="Emilio Cobos Álvarez (:emilio)">emilio</who>
    <bug_when>2024-10-23 11:57:26 -0700</bug_when>
    <thetext>To be clear, this is dependent on attribute ordering, and is not allowed by the spec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2071672</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-10-30 12:00:52 -0700</bug_when>
    <thetext>&lt;rdar://problem/138934744&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2073732</commentid>
    <comment_count>3</comment_count>
      <attachid>473183</attachid>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2024-11-07 22:46:37 -0800</bug_when>
    <thetext>Created attachment 473183
testcase as html file

Thanks Emilio,
I can confirm this is happening on the latest versions of Safari. 

There is a load event on Safari
event: load, target: [object HTMLImageElement]

On the other hand I do not see the bug happening on Chrome. 
Google Chrome Canary       132.0.6825.0  6825.0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2073734</commentid>
    <comment_count>4</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2024-11-07 23:18:24 -0800</bug_when>
    <thetext>There must be a question of timing in the execution of that code, because if I do a step by step in the Web Inspector Sources tab. The image is not being loaded.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>473021</attachid>
            <date>2024-10-23 11:57:00 -0700</date>
            <delta_ts>2024-10-23 11:57:00 -0700</delta_ts>
            <desc>Testcase</desc>
            <filename>file_281998.txt</filename>
            <type>text/plain</type>
            <size>462</size>
            <attacher name="Emilio Cobos Álvarez (:emilio)">emilio</attacher>
            
              <data encoding="base64">PCFkb2N0eXBlIGh0bWw+DQo8ZGl2IGlkPSJjb250YWluZXIiPg0KICAgIEZvb2QNCjwvZGl2Pg0K
PHNjcmlwdD4NCiAgICAvLyBjcmVhdGUgYW4gaW1hZ2UgZWxlbWVudCBhbmQgc2V0IGxhenkgbG9h
ZGluZyBvbiBpdA0KICAgIHZhciBpbWcgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdpbWcnKTsN
CiAgICBpbWcuc3JjID0gJ2h0dHBzOi8vd3B0LmxpdmUvaW1hZ2VzL2dyZWVuLnBuZz8nICsgTWF0
aC5yYW5kb20oKTsNCiAgICBpbWcubG9hZGluZyA9ICdsYXp5JzsNCiAgICBpbWcuc3R5bGUgPSAi
ZGlzcGxheTogbm9uZSI7DQogICAgaW1nLmFkZEV2ZW50TGlzdGVuZXIoJ2xvYWQnLCBmdW5jdGlv
bigpIHsNCiAgICAgICAgY29uc29sZS5sb2coJ0ltYWdlIGxvYWRlZCcpOw0KICAgICAgICBpbWcu
c3R5bGUgPSAiIg0KICAgIH0pOw0KICAgIGNvbnRhaW5lci5hcHBlbmRDaGlsZChpbWcpOw0KPC9z
Y3JpcHQ+
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>473183</attachid>
            <date>2024-11-07 22:46:37 -0800</date>
            <delta_ts>2024-11-07 22:46:37 -0800</delta_ts>
            <desc>testcase as html file</desc>
            <filename>testcase.html</filename>
            <type>text/html</type>
            <size>447</size>
            <attacher name="Karl Dubost">karlcow</attacher>
            
              <data encoding="base64">PCFkb2N0eXBlIGh0bWw+CjxkaXYgaWQ9ImNvbnRhaW5lciI+CiAgICBGb29kCjwvZGl2Pgo8c2Ny
aXB0PgogICAgLy8gY3JlYXRlIGFuIGltYWdlIGVsZW1lbnQgYW5kIHNldCBsYXp5IGxvYWRpbmcg
b24gaXQKICAgIHZhciBpbWcgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdpbWcnKTsKICAgIGlt
Zy5zcmMgPSAnaHR0cHM6Ly93cHQubGl2ZS9pbWFnZXMvZ3JlZW4ucG5nPycgKyBNYXRoLnJhbmRv
bSgpOwogICAgaW1nLmxvYWRpbmcgPSAnbGF6eSc7CiAgICBpbWcuc3R5bGUgPSAiZGlzcGxheTog
bm9uZSI7CiAgICBpbWcuYWRkRXZlbnRMaXN0ZW5lcignbG9hZCcsIGZ1bmN0aW9uKCkgewogICAg
ICAgIGNvbnNvbGUubG9nKCdJbWFnZSBsb2FkZWQnKTsKICAgICAgICBpbWcuc3R5bGUgPSAiIgog
ICAgfSk7CiAgICBjb250YWluZXIuYXBwZW5kQ2hpbGQoaW1nKTsKPC9zY3JpcHQ+
</data>

          </attachment>
      

    </bug>

</bugzilla>