RESOLVED FIXED 240083
Use correct document as root for lazy image observer
https://bugs.webkit.org/show_bug.cgi?id=240083
Summary Use correct document as root for lazy image observer
dukejoon
Reported 2022-05-04 15:00:15 PDT
Hi, In Safari 15.4 we've noticed an error with the attribute loading="lazy". HTML img tag with this attribute are not loading consistently. If you check the network tab you will see that the images are not being requested at all. So far, the solution is to remove the attribute or use loading="eager". You can successfully replicate it with this codesanbox (https://codepen.io/intellix/pen/JjMwWae). Found it here (https://github.com/Fyrd/caniuse/issues/6243). Additionally if you go to "Develop > Experimental Features" and disable "Lazy image loading" the images with loading="lazy" will load consistently.
Attachments
Patch (1.73 KB, patch)
2022-05-05 11:54 PDT, Rob Buis
no flags
Patch (5.63 KB, patch)
2022-05-06 08:38 PDT, Rob Buis
no flags
Rob Buis
Comment 1 2022-05-05 08:21:44 PDT
The html seems to work fine in a standalone file, but as soon as it is embedded in an iframe no image load is triggered.
Radar WebKit Bug Importer
Comment 2 2022-05-05 09:01:16 PDT
Rob Buis
Comment 3 2022-05-05 11:54:33 PDT
Simon Fraser (smfr)
Comment 4 2022-05-05 13:22:35 PDT
Comment on attachment 458903 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=458903&action=review > Source/WebCore/ChangeLog:8 > + Use document as root for lazy image observer. The iframe's document?
Simon Fraser (smfr)
Comment 5 2022-05-05 13:23:04 PDT
Can you test lazy image loading with Command-+ zoom too? I believe we might have some intersection observer bugs with zooming.
Rob Buis
Comment 6 2022-05-06 08:38:22 PDT
EWS Watchlist
Comment 7 2022-05-06 08:39:49 PDT
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
EWS
Comment 8 2022-05-06 17:09:29 PDT
Committed r293933 (250379@main): <https://commits.webkit.org/250379@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 458952 [details].
Note You need to log in before you can comment on or make changes to this bug.