Bug 208094

Summary: Enable lazy image loading by default
Product: WebKit Reporter: Maciej Stachowiak <mjs>
Component: ImagesAssignee: Nikos Mouchtaris <nmouchtaris>
Status: RESOLVED FIXED    
Severity: Enhancement CC: addyo, adieulot, bugmail, jonlee, mjs, nicolas, nmouchtaris, pp.mizdra, rik, rwlbuis, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=230998
https://bugs.webkit.org/show_bug.cgi?id=237660
Bug Depends on: 200764, 203557, 207901, 208119    
Bug Blocks: 196698    
Attachments:
Description Flags
Patch
none
enable lazy image load for webkit
none
enable lazy image load for webkit
none
Patch simon.fraser: review+

Description Maciej Stachowiak 2020-02-22 12:28:07 PST
This bug tracks enabling lazy image loading by default in WebKit trunk, once it seems ready.
Comment 1 Maciej Stachowiak 2020-02-22 12:29:21 PST
I'm not sure it's ready to be turned on yet, but this is a bug to track for when it's ready.
Comment 2 Radar WebKit Bug Importer 2020-02-22 12:30:22 PST
<rdar://problem/59700020>
Comment 3 Addy Osmani 2021-10-13 22:32:51 PDT
With the dependencies for this bug now closed (200764, 203557, 207901, 208119), is there a good chance loading=lazy might be turned on by default soon?
Comment 4 Nikos Mouchtaris 2021-10-14 10:27:52 PDT
Created attachment 441235 [details]
Patch
Comment 5 Simon Fraser (smfr) 2021-10-14 12:13:18 PDT
Comment on attachment 441235 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=441235&action=review

> Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml:694
> -      default: false
> +      default: true

Is this tested?

> Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml:698
> -      default: false
> +      default: true

I think you want to leave this off by default. It only applies in some weird situations (maybe the fake Page associated with SVG images or something).
Comment 6 Nikos Mouchtaris 2021-10-14 13:25:40 PDT
Created attachment 441268 [details]
enable lazy image load for webkit
Comment 7 Nikos Mouchtaris 2021-10-14 14:42:59 PDT
Created attachment 441289 [details]
enable lazy image load for webkit
Comment 8 EWS 2021-10-14 19:22:01 PDT
Committed r284228 (243037@main): <https://commits.webkit.org/243037@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 441289 [details].
Comment 9 Anthony Ricaud 2021-10-28 03:40:43 PDT
It seems this patch enabled `IsSameSiteStrictEnforcementEnabled` instead of `LazyImageLoadingEnabled`.


$ git show --pretty=oneline 30c67adc54a265473c4fd44bbab6702e9be4487a -- Source/WTF/Scripts/                                                                       at 11:39:12 
30c67adc54a265473c4fd44bbab6702e9be4487a Enable lazy image loading by default https://bugs.webkit.org/show_bug.cgi?id=208094
diff --git Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml
index 0266e84653..d9e36c19ed 100644
--- Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml
+++ Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml
@@ -700,7 +700,7 @@ IsSameSiteStrictEnforcementEnabled:
     WebKitLegacy:
       default: false
     WebKit:
-      default: false
+      default: true
     WebCore:
       default: false

Notice @@ -700,7 +700,7 @@ IsSameSiteStrictEnforcementEnabled:
Comment 10 Simon Fraser (smfr) 2021-10-28 08:24:48 PDT
You're right. The patches look correct. I wonder if this was a merge issue by commit-queue.
Comment 11 Nikos Mouchtaris 2021-10-28 10:39:45 PDT
Created attachment 442718 [details]
Patch
Comment 12 Alexey Proskuryakov 2021-10-28 11:11:59 PDT
Seems like something that needs a manual commit!
Comment 13 Nikos Mouchtaris 2021-10-28 12:56:11 PDT
Committed r284995 (243641@main): <https://commits.webkit.org/243641@main>