Open yoavweiss opened 2 years ago
I don't understand how that can happen in the first place. If A is 50x50, how does it suddenly then become 100x50? The only way I can see this happening is if the image container itself is expanded. Since we shrink the images based on intrinsic sizes, it wouldn't affect the LCP size. If instead you mean A gets a different image, then that's a different LCP candidate.
One example could be where A is a background image of a node that truncates it, and then gets resized to no longer truncate it (or truncate it less).
Oh I see, so this is specific to background images? How often would this happen? Are there use-cases for this? The main reason from my perspective is performance. Also, would this suggest shrinking the size if the candidate is shrank? That would complicate things as we'd have to go back to storing all LCP candidates.
I guess this is also true for html-based images that had initially larger intrinsic size than their display dimensions, and were then changed to have larger dimensions.
Also, would this suggest shrinking the size if the candidate is shrank?
No, for the same reasons we don't look into removed images.
Also, due to intersection being part of the size calc, can't a below-the-fold element receive a larger entry while scrolling? Sounds like this has to happen...
Also, due to intersection being part of the size calc, can't a below-the-fold element receive a larger entry while scrolling?
Also, due to intersection being part of the size calc, can't a below-the-fold element receive a larger entry while scrolling?
Thanks, of course, I missed that!
IMO, there's no strong reason to not fire LCP entries again. The next step is to get a PR going that removes the content set, as well as tests to go along with it.
In https://wicg.github.io/largest-contentful-paint/#sec-add-lcp-entry step 2 ensures that elements that already fired an entry will not fire another entry again. I'd like to better understand the reasoning for it, as it seems counter-intuitive, at least in some cases. e.g. There could be a case where an image A of 50x50 is the LCP, followed by an image B that's 75x50. If A then gets resized to 100x50, we'd want the largest LCP candidate to be A with the right size, not B.