Bug 305256

Summary: LCP buffer size seems to be set to 1 instead of 150
Product: WebKit Reporter: Barry Pollard <barry>
Component: Layout and RenderingAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, karlcow, ryan, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari 26   
Hardware: Mac (Apple Silicon)   
OS: macOS 15   
Attachments:
Description Flags
Prospective test none

Barry Pollard
Reported 2026-01-10 03:03:21 PST
This page loads some text and then a delayed `<img>` 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) => { for (const entry of entryList.getEntries()) { console.log('LCP candidate:', entry.startTime, entry); } }).observe({type: 'largest-contentful-paint', buffered: true}); ``` This page also loads some text and then a delayed `<img>`, 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'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
Attachments
Prospective test (1.60 KB, text/html)
2026-01-20 16:26 PST, Simon Fraser (smfr)
no flags
Barry Pollard
Comment 1 2026-01-10 03:04:38 PST
Urgh, sorry that second test URL should be: https://www.tunetheweb.com/experiments/lcp/h1-image-delay.html
Radar WebKit Bug Importer
Comment 2 2026-01-12 13:51:53 PST
Simon Fraser (smfr)
Comment 3 2026-01-12 19:56:00 PST
Barry Pollard
Comment 4 2026-01-12 23:32:45 PST
Simon Fraser (smfr)
Comment 5 2026-01-20 16:10:42 PST
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?
Simon Fraser (smfr)
Comment 6 2026-01-20 16:26:37 PST
Created attachment 478082 [details] Prospective test Adding a WPT that I think should show that the buffer size is > 1.
Barry Pollard
Comment 7 2026-01-20 17:38:10 PST
> 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
Simon Fraser (smfr)
Comment 8 2026-01-20 18:07:40 PST
Got it, sorry I missed that (oh for editable comments)
Simon Fraser (smfr)
Comment 9 2026-02-19 15:04:40 PST
We need an implementation of https://w3c.github.io/performance-timeline/#dfn-queue-a-performanceentry shared between different performance entry types.
Simon Fraser (smfr)
Comment 10 2026-04-28 18:47:32 PDT
EWS
Comment 11 2026-04-30 14:46:14 PDT
Committed 312393@main (86af78950458): <https://commits.webkit.org/312393@main> Reviewed commits have been landed. Closing PR #63862 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.