Today, the LCP spec wording suggests that multiple LCP candidates would be emitted within a single Paint / rendering update, in cases where there are multiple new "largest" candidates in one paint operation but the overall largest isn't first.
The algorithm already has access to all image & text paint records, so we could easily just take the single largest instead.
See Context.
- Paint Timing Spec defines "mark paint timing" called from HTML "update the rendering"
- Per spec, we collect a set of ALL painted image/text nodes that paint.
- We create a callback in step 10 to
flushPaintTimings. (This is optionally called synchronously, or in parallel after presentation time is available)
flushPaintTimings calls "report largest contentful paint" with the list of image/text candidates.
- "report largest contentful paint", will iterate the list (in arbitrary order) and create entries.
Today, the LCP spec wording suggests that multiple LCP candidates would be emitted within a single Paint / rendering update, in cases where there are multiple new "largest" candidates in one paint operation but the overall largest isn't first.
The algorithm already has access to all image & text paint records, so we could easily just take the single largest instead.
See Context.
flushPaintTimings. (This is optionally called synchronously, or in parallel after presentation time is available)flushPaintTimingscalls "report largest contentful paint" with the list of image/text candidates.