commit | 8996d0122ced2d6af980905ac33383e799eff31b | [log] [tgz] |
---|---|---|
author | Liquan(Max) Gu <[email protected]> | Mon Aug 12 20:18:19 2019 |
committer | Nicolás Peña Moreno <[email protected]> | Mon Aug 12 20:18:19 2019 |
tree | 9f54026ac93429258533f84731397ba5404fc5eb | |
parent | 34fd49162ba4ab8ff9224fc5002c5dbdc02e918d [diff] |
[M77][LCP] Update LCP when both text and image are ready Largest Contentful Paint compares the text and the image candidate to decide which is the largest candidate. Currently, LCP generates a result entry between updating the text candidate and the image candidate, which produces an intermediate result. It causes the issue in crbug.com/988115, #c4 explains the mechanism of the bug. To remove the intermediate state, this CL changes the way LCP-calculator takes the text candidate and image candidate. Instead of notifying LCP-calculator of the text candidate's update right after the update, we wait until both text candidate and image candidate have been updated to notify LCP-calculator. Also, LCP-calculator adds the logic of checking whether candidate has changed, from ImagePaintTimingDetector and TextPaintTimingDetector. Although it's redundant with |UpdateCandidate| in text and image, these are necessary because going forwards, the "has_changed" logic in both detectors would have to be removed along with the LIP and LTP logic. This CL also considers the chances where either detector is destroyed, where it would no longer be able to find the largest candidate. In this case, perf API would use the last reported candidate as the candidate to compare with the candidate from another detector, in order to decide the largest between text and image. Bug: 982307, 988115 (cherry picked from commit 77c7dc37185a13f5e379b0e8338f0ed3bd0f1f01) Change-Id: I562c7aeab6037678dd4bd7d6eddacdeb5be8bfbc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1733456 Commit-Queue: Liquan (Max) Gu <[email protected]> Reviewed-by: Steve Kobes <[email protected]> Cr-Original-Commit-Position: refs/heads/master@{#685300} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1749843 Reviewed-by: Nicolás Peña Moreno <[email protected]> Cr-Commit-Position: refs/branch-heads/3865@{#333} Cr-Branched-From: 0cdcc6158160790658d1f033d3db873603250124-refs/heads/master@{#681094}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .