w3c / largest-contentful-paint

Specification for the LargestContentfulPaint API
https://w3c.github.io/largest-contentful-paint/
Other
88 stars 16 forks source link

Are the units of LargestContentfulPaint.size in pixels? #76

Closed dashed closed 2 years ago

dashed commented 3 years ago

Are the units of LargestContentfulPaint.size in pixels?

It's non-obvious to me from the spec that it is: https://wicg.github.io/largest-contentful-paint/#dom-largestcontentfulpaint-size

npm1 commented 3 years ago

Good question, I believe the answer should be layout units. Perhaps we can add a clarification in the readme or the spec?

dashed commented 3 years ago

@npm1 That'll be helpful to clarify. Intuitively, it feels like it is pixels squared (px²); or layout units squared.

npm1 commented 3 years ago

Oh yea the algorithm computing the rect is actually coming from Element Timing, so it does seem hard to reason about it. I can add some text to the explainer (the README) to make it clearer.