Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elements that are obscured by other elements shouldn't be considered #70

Open
patrickhulce opened this issue Dec 17, 2020 · 5 comments
Open

Comments

@patrickhulce
Copy link

patrickhulce commented Dec 17, 2020

We came across an amusing case in Lighthouse where the LCP element was completely obscured by another element with a higher z-index.

It's definitely unfortunate that LCP flags something that is effectively outside the viewport from the user's perspective. I can imagine that determining occlusion would be computationally expensive (and impossible in some cases) though. Would it be possible to consider more forms of visibility like this in the metric definition? Was there consideration or a discussion on this in the past I can refer to?

@npm1
Copy link
Collaborator

npm1 commented Dec 17, 2020

That has definitely come up in the past but doesn't seem super common. You're right that this is not ideal but I will pass on the feedback to the rendering team who will have more informed opinions on whether it is computationally feasible to consider occlusion.

@noamr
Copy link
Contributor

noamr commented Sep 8, 2022

I think the spec shouldn't deal with it. UAs can try to track this and put warning-ish things in their dev-tools like "your LCP is occluded".

@yoavweiss
Copy link
Contributor

@noamr - why shouldn't we handle this at the spec level? (assuming implementation of this is feasible, that's still TBD)

@noamr
Copy link
Contributor

noamr commented Dec 7, 2022

@noamr - why shouldn't we handle this at the spec level? (assuming implementation of this is feasible, that's still TBD)

because occlusion is a really hard problem to solve in an interoperable way. The value of solving it here is not high - if a large image is completely occluded, maybe the occluding content is more important to the users?
But this is an opinion and open for discussion.

@nhoizey
Copy link

nhoizey commented Jun 6, 2023

I have noticed the same issue on my photography site where I visually stack some photos above each other. The one in the back if reported as the LCP, while we can see only a little part of it:
https://mamot.fr/@nhoizey/110496230467676162

Here's a WebPageTest result:
https://www.webpagetest.org/vitals.php?test=230606_BiDc1E_6ZR&run=3&cached=0#lcp

Tricky situation here: the image in the back is overall smaller than the one in the front, but the fold "cuts" the bottom of the later, so the area above the fold considered for LCP is larger for the back image.

But I think the back image should not be the LCP anyway, as we don't see much of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants