Bug 310264

Summary: LCP in shadow DOM is not reported
Product: WebKit Reporter: smrtnyk
Component: Layout and RenderingAssignee: Simon Fraser (smfr) <simon.fraser>
Status: REOPENED    
Severity: Normal CC: barry, bfulgham, commit-queue, erik.witt, karlcow, nicole, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 311575    
Bug Blocks:    
Attachments:
Description Flags
you will need to install playwright test for this none

smrtnyk
Reported 2026-03-19 01:35:18 PDT
Created attachment 478720 [details] you will need to install playwright test for this Both chrome and firefox report LCP coming from shadow dom but webkit doesn't. Given a scenario if image is loaded from shadow dom and is the best LCP candidate, chrome and firefox will report it as an lcp where webkit will ignore it and take only candidates from regular DOM. I am not really sure if webkit is more behaving to spec or not. It could be that firefox aligned to Chrome and webkit decided to follow the spec more closely. Relevant links: • LCP spec: https://w3c.github.io/largest-contentful-paint/ (section 4.2) • Paint Timing spec: https://w3c.github.io/paint-timing/ (section 5.4.1 "Exposed for paint timing") The LCP spec section 4.2 step 5.2 says If imageElement is not exposed for paint timing, given document, continue. in Paint timing spec seciton 5.4.1 step 4 If element’s root is not equal to document, return false. I am not sure how to interpret it. I have attached a test script you can run via node It uses @playwright/test in order to run all 3 browsers.
Attachments
you will need to install playwright test for this (4.01 KB, text/javascript)
2026-03-19 01:35 PDT, smrtnyk
no flags
Simon Fraser (smfr)
Comment 1 2026-03-23 17:40:28 PDT
I thought there was a web platform test for this that we passed.
Radar WebKit Bug Importer
Comment 2 2026-03-23 17:40:48 PDT
Simon Fraser (smfr)
Comment 3 2026-04-03 17:16:19 PDT
EWS
Comment 4 2026-04-04 08:35:43 PDT
Committed 310575@main (0b5c61add5d5): <https://commits.webkit.org/310575@main> Reviewed commits have been landed. Closing PR #62008 and removing active labels.
EWS
Comment 5 2026-04-04 21:13:00 PDT
Committed 305413.615@safari-7624-branch (c1f3664d9ebb): <https://commits.webkit.org/305413.615@safari-7624-branch> Reviewed commits have been landed. Closing PR #4896 and removing active labels.
WebKit Commit Bot
Comment 6 2026-04-06 11:27:19 PDT
Re-opened since this is blocked by bug 311575
Simon Fraser (smfr)
Comment 7 2026-04-06 11:29:16 PDT
It's not clear from specs about whether this is correct, so reverted.
Simon Fraser (smfr)
Comment 8 2026-04-06 11:38:23 PDT
Note You need to log in before you can comment on or make changes to this bug.