Open rik opened 3 years ago
I agree this should not count as LCP, as the metric should be well-aligned with user experience, and this hack prevents that alignment and erodes trust in the metric.
/cc @clelland
Not sure there is a solution to hermetically seal against this type of hack in the spec, even if we introduce some intricate solution specifically for SVG with only transparent elements.
I think the solution for this lies outside the standard LCP metric - to detect LCP fraud in whatever piece relies on LCP for rewarding/penalizing the site somehow (e.g. search-engine ranking and the likes).
One thing that comes to mind though is to somehow take overlapping elements into account. If you have something big and then a lot of small things start to come and overlap with it, only count the non-overlapping parts as "early". Something like this:
I think this change solved this https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/speed/metrics_changelog/2023_04_lcp.md
It should solve that; I just need to write it up as a spec change before this can be closed.
This technique is floating around to game the metric.
The base64 string encodes the following SVG