w3c / largest-contentful-paint

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

Add a content map to handle element removal #42

Closed npm1 closed 5 years ago

npm1 commented 5 years ago

This PR adds logic to keep track of content by using a pair of (element, request) to identify content and using a map to retain the needed information to populate an LCP entry. The PR adds logic to properly update the largest content when an element is removed from the page. It is missing logic to update when an image is removed but the element is not (src change, background image removal, etc.), and this can be done in a followup. Adding myself as editor as this is a pretty substantial change.


Preview | Diff

npm1 commented 5 years ago

Ping!

npm1 commented 5 years ago

No worries, and ptal again :)

npm1 commented 5 years ago

Let me know if this looks good to land. Thanks!