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 using CSS image-set() for background should be considered LCP candidates #116

Open
ryantownsend opened this issue Sep 1, 2023 · 2 comments
Assignees

Comments

@ryantownsend
Copy link

ryantownsend commented Sep 1, 2023

As per web.dev, elements with background images are considered LCP candidates, but only when using url():

An element with a background image loaded via the url() function (as opposed to a CSS gradient)

However, we now have image-set() and the upcoming image() (hat-tip @Schepp) which are alternative methods of loading background images with additional functionality (e.g. content-type selection), so the LCP spec should be updated to consider these as valid candidates also.

I have two test pages to demonstrate the behaviour by simply swapping url() for image-set() in the CSS:

Update: I've logged a parallel Chromium bug to address the implementation

@clelland
Copy link
Collaborator

clelland commented Sep 5, 2023

I think that WICG/element-timing might be the place to fix this, since LCP (mostly) builds on top of that spec, and an image with elementtiming set which happens to use this directive should report the correct timing info there as well.

@clelland clelland self-assigned this Sep 5, 2023
@yoavweiss
Copy link
Contributor

I think that WICG/element-timing might be the place to fix this, since LCP (mostly) builds on top of that spec, and an image with elementtiming set which happens to use this directive should report the correct timing info there as well.

We need to merge the two specs, tbh.. We'll discuss that at TPAC.

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

3 participants