Skip to content

Report LCP algorithm should limit to single largest paint candidate, per report #135

@mmocny

Description

@mmocny

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions