[LargestContentfulPaint] Fix loadTime for background images #18404
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This CL fixes the loadTime of background images for the LargestContentfulPaint
web API. The StyleFetchedImage is now needed in the OnImageLoaded() method.
Instead of computing the timestamp again, we query it from the
ImageElementTiming class. This should be populated whenever ElementTiming is
enabled. While it is still behind a flag, it is set to 'stable' so it should be
on by default. A test is added to ensure that the loadTime is populated properly
in a case where it wouldn't be previously.
Bug: 965505, 986891
Change-Id: I7c3421006cec0dbd79c50a21ae055f11b7ce3ce2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1752295
Reviewed-by: Steve Kobes <skobes@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#687242}