Open Bug 1542784 Opened 5 months ago Updated 3 days ago

Support <img loading="lazy"> lazy-loading

Categories

(Core :: HTML: Parser, enhancement)

67 Branch
enhancement
Not set

Tracking

()

UNCONFIRMED
Webcompat Priority ?

People

(Reporter: jmcbray, Unassigned)

Details

(Keywords: dev-doc-needed, Whiteboard: [webcompat])

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0

Steps to reproduce:

Chrome is adding support for lazy loading images and iframes, as specified here: https://github.com/scott-little/lazyload/.

Actual results:

Firefox does not support this syntax, and I could not find an existing bug requesting it.

Expected results:

Firefox should also implement this. Currently, lazy-loading images not only requires using JavaScript, it also requires writing your HTML in such a way that your images will not be loaded at all with JavaScript disabled. Putting image lazy-loading in the browser's handling of the <img> tag makes it possible to provide this in a more robust way, lower down the web stack - you can confidently use the <img loading="lazy"> syntax and know that the fallback to eager loading will work in all browsers.

Type: defect → enhancement

Bug report for the old "lazyload" attribute: https://bugzilla.mozilla.org/show_bug.cgi?id=947427

There isn't yet a reasonable spec for lazyload, but it does feel like a good addition to the web platform.

Keywords: dev-doc-needed

WHATWG Pull Request for "loading" attribute: https://github.com/whatwg/html/pull/3752

Flags: webcompat?
Whiteboard: [webcompat]

Migrating Webcompat whiteboard priorities to project flags. See bug 1547409.

Webcompat Priority: --- → ?

See bug 1547409. Migrating whiteboard priority tags to program flags.

Component: Untriaged → HTML: Parser
Product: Firefox → Core

Starting with Chrome 76, you'll be able to use the new loading attribute to lazy-load resources without the need to write custom lazy-loading code or use a separate JavaScript library. — https://web.dev/native-lazy-loading

You need to log in before you can comment on or make changes to this bug.