10BC0 Enable lazy loading for URLs on use href · Issue #9929 · whatwg/html · GitHub
[go: up one dir, main page]

Skip to content

Enable lazy loading for URLs on use href #9929

@lfre

Description

@lfre

What problem are you trying to solve?

The loading attribute enables lazy-loading for images and iframes. Likewise, the <use> tag could use this functionality to enable deferring the loading of SVGs as an URL. E.g:

<svg>
	<use href="/path/to/my.svg" loading="lazy" />
</svg>

What solutions exist today?

Similar to polyfills for lazy-loading, an Intersection Observer mechanism can be used to swap a data-href attribute to href when approaching in view.

How would you solve i 5E22 t?

Enable the loading attribute to act like on img and iframe, and defer the loading of the SVG until approaches in view.

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    addition/proposalNew features or enhancementsneeds implementer interestMoving the issue forward requires implementers to express interest

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0