Bug 1615234 - Make the lazyload pref actually be honored. r=hiro

Right now it only controls the visibility of HTMLImageElement.loading.

Differential Revision: https://phabricator.services.mozilla.com/D62723
This commit is contained in:
Emilio Cobos Álvarez
2020-02-13 11:03:12 +00:00
parent a490237d2b
commit 7dfd900d09

View File

@@ -1250,6 +1250,10 @@ void HTMLImageElement::SetLazyLoading() {
return;
}
if (!StaticPrefs::dom_image_lazy_loading_enabled()) {
return;
}
// If scripting is disabled don't do lazy load.
// https://whatpr.org/html/3752/images.html#updating-the-image-data
if (!OwnerDoc()->IsScriptEnabled()) {