Bug 1842984 Remove dom.image-lazy-loading.enabled r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D184883
This commit is contained in:
renevietnam29@gmail.com 2023-08-23 13:26:36 +00:00
parent e115104963
commit 2a0eb51c7e
7 changed files with 3 additions and 18 deletions

View File

@ -1296,10 +1296,6 @@ 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
//

View File

@ -41,7 +41,7 @@ interface HTMLImageElement : HTMLElement {
attribute unsigned long height;
[CEReactions, SetterThrows]
attribute DOMString decoding;
[CEReactions, SetterThrows, Pref="dom.image-lazy-loading.enabled"]
[CEReactions, SetterThrows]
attribute DOMString loading;
readonly attribute unsigned long naturalWidth;
readonly attribute unsigned long naturalHeight;

View File

@ -15,7 +15,6 @@ SpecialPowers.pushPrefEnv(
// the `alt` change.
{
set: [
["dom.image-lazy-loading.enabled", true],
["dom.image-lazy-loading.root-margin.top", 0],
["dom.image-lazy-loading.root-margin.bottom", 0],
["dom.image-lazy-loading.root-margin.left", 0],

View File

@ -67,7 +67,7 @@ fails-if(useDrawSnapshot) == image-srcset-svg-default-2x.html image-srcset-svg-d
== image-resize-percent-width.html image-resize-ref.html
== moz-broken-matching-1.html moz-broken-matching-1-ref.html
pref(dom.image-lazy-loading.enabled,true) == moz-broken-matching-lazy-load.html moz-broken-matching-1-ref.html
== moz-broken-matching-lazy-load.html moz-broken-matching-1-ref.html
== img-invalidation-local-transform-1.html img-invalidation-local-transform-1-ref.html
== unknown-protocol.html unknown-protocol-ref.html

View File

@ -2706,14 +2706,6 @@
value: false
mirror: always
# <img loading="lazy">
#
# See https://github.com/whatwg/html/pull/3752
- name: dom.image-lazy-loading.enabled
type: RelaxedAtomicBool
value: true
mirror: always
# The root margin for image lazy loading, defined as four (value, percentage)
# pairs.
- name: dom.image-lazy-loading.root-margin.top

View File

@ -183,8 +183,7 @@ nsIContentHandle* nsHtml5TreeBuilder::createElement(
if (nsGkAtoms::img == aName) {
nsHtml5String loading =
aAttributes->getValue(nsHtml5AttributeName::ATTR_LOADING);
if (!mozilla::StaticPrefs::dom_image_lazy_loading_enabled() ||
!loading.LowerCaseEqualsASCII("lazy")) {
if (!loading.LowerCaseEqualsASCII("lazy")) {
nsHtml5String url =
aAttributes->getValue(nsHtml5AttributeName::ATTR_SRC);
nsHtml5String srcset =

View File

@ -1 +0,0 @@
prefs: [dom.image-lazy-loading.enabled:true]