<?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>305256</bug_id>
          
          <creation_ts>2026-01-10 03:03:21 -0800</creation_ts>
          <short_desc>LCP buffer size seems to be set to 1 instead of 150</short_desc>
          <delta_ts>2026-04-30 14:46:16 -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>Safari 26</version>
          <rep_platform>Mac (Apple Silicon)</rep_platform>
          <op_sys>macOS 15</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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="Barry Pollard">barry</reporter>
          <assigned_to name="Simon Fraser (smfr)">simon.fraser</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>karlcow</cc>
    
    <cc>ryan</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>2170893</commentid>
    <comment_count>0</comment_count>
    <who name="Barry Pollard">barry</who>
    <bug_when>2026-01-10 03:03:21 -0800</bug_when>
    <thetext>This page loads some text and then a delayed `&lt;img&gt;`

https://www.tunetheweb.com/experiments/lcp/h1-image.html

The LCP is correctly reports LCP candidates as:

```
h1#heading
img
```

These are got from and LCP performance observer - basically this code:

```js
new PerformanceObserver((entryList) =&gt; {
  for (const entry of entryList.getEntries()) {
    console.log(&apos;LCP candidate:&apos;, entry.startTime, entry);
  }
}).observe({type: &apos;largest-contentful-paint&apos;, buffered: true});
```

This page also loads some text and then a delayed `&lt;img&gt;`, but delays starting the performance observer for two seconds (after the image has loaded):

https://www.tunetheweb.com/experiments/lcp/h1-image.html

In this case the LCP candidates only contains the second image:

```
img
```

While the largest element is usually the most important for LCP, it&apos;s useful for debugging purposes to understand if LCP changed over time, even if a performance observer was setup intitall.

The registry says LCP should have a buffer size of 150:
https://w3c.github.io/timing-entrytypes-registry/#registry</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2170894</commentid>
    <comment_count>1</comment_count>
    <who name="Barry Pollard">barry</who>
    <bug_when>2026-01-10 03:04:38 -0800</bug_when>
    <thetext>Urgh, sorry that second test URL should be:
https://www.tunetheweb.com/experiments/lcp/h1-image-delay.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2171262</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2026-01-12 13:51:53 -0800</bug_when>
    <thetext>&lt;rdar://problem/168015751&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2171324</commentid>
    <comment_count>3</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2026-01-12 19:56:00 -0800</bug_when>
    <thetext>Sure would be nice if https://www.w3.org/TR/largest-contentful-paint/ referenced https://w3c.github.io/timing-entrytypes-registry/#registry</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2171351</commentid>
    <comment_count>4</comment_count>
    <who name="Barry Pollard">barry</who>
    <bug_when>2026-01-12 23:32:45 -0800</bug_when>
    <thetext>Agreed! Raised this: https://github.com/w3c/largest-contentful-paint/issues/157</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2173492</commentid>
    <comment_count>5</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2026-01-20 16:10:42 -0800</bug_when>
    <thetext>https://www.tunetheweb.com/experiments/lcp/h1-image.html gives me
```
h1#heading
img
```
in Safari, and STP.

Also, in a standalone test that tries to exercise the buffer limit, Chrome seems to have a buffer size of 1.

Do you have a test that explicitly tests the buffer size?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2173498</commentid>
    <comment_count>6</comment_count>
      <attachid>478082</attachid>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2026-01-20 16:26:37 -0800</bug_when>
    <thetext>Created attachment 478082
Prospective test

Adding a WPT that I think should show that the buffer size is &gt; 1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2173528</commentid>
    <comment_count>7</comment_count>
    <who name="Barry Pollard">barry</who>
    <bug_when>2026-01-20 17:38:10 -0800</bug_when>
    <thetext>&gt; Do you have a test that explicitly tests the buffer size?

Yes as per comment https://bugs.webkit.org/show_bug.cgi?id=305256#c1 the following test gives different results in Chrome and Safari:

https://www.tunetheweb.com/experiments/lcp/h1-image-delay.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2173535</commentid>
    <comment_count>8</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2026-01-20 18:07:40 -0800</bug_when>
    <thetext>Got it, sorry I missed that (oh for editable comments)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2183167</commentid>
    <comment_count>9</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2026-02-19 15:04:40 -0800</bug_when>
    <thetext>We need an implementation of https://w3c.github.io/performance-timeline/#dfn-queue-a-performanceentry shared between different performance entry types.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2205617</commentid>
    <comment_count>10</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2026-04-28 18:47:32 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/63862</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2206391</commentid>
    <comment_count>11</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-04-30 14:46:14 -0700</bug_when>
    <thetext>Committed 312393@main (86af78950458): &lt;https://commits.webkit.org/312393@main&gt;

Reviewed commits have been landed. Closing PR #63862 and removing active labels.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>478082</attachid>
            <date>2026-01-20 16:26:37 -0800</date>
            <delta_ts>2026-01-20 16:26:37 -0800</delta_ts>
            <desc>Prospective test</desc>
            <filename>lcp-buffer-size.html</filename>
            <type>text/html</type>
            <size>1637</size>
            <attacher name="Simon Fraser (smfr)">simon.fraser</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIEhUTUw+CjxtZXRhIGNoYXJzZXQ9dXRmLTg+Cjx0aXRsZT5MYXJnZXN0Q29udGVu
dGZ1bFBhaW50IGNvbXBhcmVkIHdpdGggRmlyc3RQYWludCBhbmQgRmlyc3RDb250ZW50ZnVsUGFp
bnQgb24gc2luZ2xlIHRleHQgcGFnZS48L3RpdGxlPgo8c3R5bGU+CiAgI2NvbnRhaW5lciA+IGRp
diB7CiAgICBtYXJnaW46IDJweDsKICAgIGJhY2tncm91bmQtY29sb3I6IGJsdWU7CiAgfQo8L3N0
eWxlPgo8Ym9keT4KPHNjcmlwdCBzcmM9Ii9yZXNvdXJjZXMvdGVzdGhhcm5lc3MuanMiPjwvc2Ny
aXB0Pgo8c2NyaXB0IHNyYz0iL3Jlc291cmNlcy90ZXN0aGFybmVzc3JlcG9ydC5qcyI+PC9zY3Jp
cHQ+CjxzZWN0aW9uIGlkPSJjb250YWluZXIiPjwvc2VjdGlvbj4KPHNjcmlwdD4KICBwcm9taXNl
X3Rlc3QoYXN5bmMgKHQpID0+IHsKICAgIGFzc2VydF9pbXBsZW1lbnRzKHdpbmRvdy5QZXJmb3Jt
YW5jZVBhaW50VGltaW5nLCAiUGVyZm9ybWFuY2VQYWludFRpbWluZyBpcyBub3QgaW1wbGVtZW50
ZWQiKTsKICAgIGFzc2Vyd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