<?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>264864</bug_id>
          
          <creation_ts>2023-11-14 22:43:53 -0800</creation_ts>
          <short_desc>Use scrollMargin for lazy load intersection observer</short_desc>
          <delta_ts>2025-04-10 17:20:43 -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>Layout and Rendering</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=263370</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P3</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Traian Captan">tcaptan</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>johannes.odland</cc>
    
    <cc>johannes.odland</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1992689</commentid>
    <comment_count>0</comment_count>
    <who name="Traian Captan">tcaptan</who>
    <bug_when>2023-11-14 22:43:53 -0800</bug_when>
    <thetext>Currently the lazy load intersection observer is set up using a rootMargin. This does not work well for pages that use images in CSS scrollers, like carousels, causing the images to load too late, when they become visible and the intersection with the root is detected. To work around this issue some developers are choosing to not use lazy loading, thus increasing the overall bandwidth usage for their sites.
This problem was discussed in issue 431(https://github.com/w3c/IntersectionObserver/issues/431).

Using scrollMargin for the lazy load intersection observer will allow lazy loading images to load when they are near the viewport as expected.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1994299</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-11-21 22:44:14 -0800</bug_when>
    <thetext>&lt;rdar://problem/118706766&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2101109</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2025-03-06 13:09:04 -0800</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 263370 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2101643</commentid>
    <comment_count>3</comment_count>
    <who name="Johannes Odland">johannes.odland</who>
    <bug_when>2025-03-08 05:53:22 -0800</bug_when>
    <thetext>@smfr This bug is not quite the same as 263370, as this bug relates to using scrollMargin for lazy loading. 

I&apos;m planning to file a separate PR for this once/if https://github.com/WebKit/WebKit/pull/40687 lands.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2101954</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2025-03-10 09:52:50 -0700</bug_when>
    <thetext>Mistaken duplication.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2109236</commentid>
    <comment_count>5</comment_count>
    <who name="Johannes Odland">johannes.odland</who>
    <bug_when>2025-04-06 04:29:04 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/43712</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2110314</commentid>
    <comment_count>6</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-04-10 17:20:40 -0700</bug_when>
    <thetext>Committed 293552@main (19ed0f7d93d1): &lt;https://commits.webkit.org/293552@main&gt;

Reviewed commits have been landed. Closing PR #43712 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>