w3c / largest-contentful-paint

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

renderTime definition is unclear in the spec for each element type #54

Open patrickhulce opened 4 years ago

patrickhulce commented 4 years ago

I had a difficult time figuring out how renderTime was defined for progressively loaded images based on the spec. Right now all the renderTime links just point to the attribute definition

The renderTime attribute must return the value of the context object’s renderTime.

Which isn't all that helpful.

Ultimately, the element timing spec example on security was the most helpful to me as it gave the specific example of the next paint after an onload handler.

Maybe there could be a section either defining or linking to the definitions of renderTime for different element types?

edit: this came out of an investigation in Lighthouse which has some interesting cases of LCP there if you're curious :) https://github.com/GoogleChrome/lighthouse/issues/10527

npm1 commented 4 years ago

Indeed to understand this spec one needs to also look at the Element Timing spec as the method to add the LCP entry is called from there. As you can see renderTime comes from there too. The explainer of that spec has some information about what it means: https://github.com/WICG/element-timing#what-information-is-exposed

I think what we need to do is augment the LCP explainer and the LCP spec usage example so that this is more clear.

patrickhulce commented 4 years ago

I think what we need to do is augment the LCP explainer and the LCP spec usage example so that this is more clear.

That would be great 👍 the information in that element timing explainer is indeed exactly what I was looking for.

yoavweiss commented 1 year ago

Belatedly getting back to this, it seems like the short term solution is to add a similar pointer to LCP's render time definition. In the longer term, we probably want to fold those two inter-dependent specs into a single one..