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

Consider including SVG elements #84

Open
npm1 opened this issue Nov 2, 2021 · 5 comments
Open

Consider including SVG elements #84

npm1 opened this issue Nov 2, 2021 · 5 comments

Comments

@npm1
Copy link
Collaborator

npm1 commented Nov 2, 2021

Currently the API only includes image inside of SVG. We should include SVG elements as a whole. In order to do this, we'd need to answer some questions:

  1. What should be the rendering time of an SVG element?
  2. What should be the size for the LCP algorithm?
@npm1
Copy link
Collaborator Author

npm1 commented Nov 3, 2021

Related issue (should make sure these APIs behave similarly when tracking similar types of content): w3c/element-timing#56

@yoavweiss
Copy link
Contributor

One interesting compication to take into account: SVG elements behave slightly different than SVG images, in that they can load other images. We should make sure that LCP takes that behavior into account, and considers the SVG image including resources it may have downloaded.

@yoavweiss
Copy link
Contributor

Strong support for this last time we discussed it. Needs someone to pick up the task.

@benschwarz
Copy link

@yoavweiss, I'd like to resurface this issue for discussion. SVGs are content and IMO shouldn't be disregarded.

On sites where SVG is used for the initial viewport, no LCP can be reported. This is true of Chrome Devtools, CrUX and Lighthouse.

Example Image
Chrome devtools image
Pagespeed image

How can we go about revisiting SVGs inclusion to LCP evaluation?

@noamr
Copy link
Contributor

noamr commented Oct 24, 2024

Perhaps we could treat SVG as in image if it is made accessible as an image, like in https://www.deque.com/blog/creating-accessible-svgs/?

<svg role=img>
   <title>...</title>
</svg>

Then we can treat this whole SVG as one big image, as if it was an <img src="foo.svg"> with equivalent sizing etc

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

4 participants