Bug 216979 - Fix image-loading-lazy-multiple-times.html
Summary: Fix image-loading-lazy-multiple-times.html
Status: REOPENED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Rob Buis
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-09-25 10:03 PDT by Rob Buis
Modified: 2020-10-18 23:22 PDT (History)
6 users (show)

See Also:


Attachments
Patch (3.42 KB, patch)
2020-09-25 10:05 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (3.67 KB, patch)
2020-10-07 13:21 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (3.67 KB, patch)
2020-10-07 22:50 PDT, Rob Buis
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Buis 2020-09-25 10:03:26 PDT
Fix image-loading-lazy-multiple-times.html
Comment 1 Rob Buis 2020-09-25 10:05:53 PDT
Created attachment 409703 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2020-10-02 10:05:23 PDT
<rdar://problem/69885316>
Comment 3 Rob Buis 2020-10-07 13:21:08 PDT
Created attachment 410771 [details]
Patch
Comment 4 Rob Buis 2020-10-07 22:50:38 PDT
Created attachment 410810 [details]
Patch
Comment 5 EWS 2020-10-08 05:49:44 PDT
Committed r268178: <https://trac.webkit.org/changeset/268178>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 410810 [details].
Comment 6 Karl Rackler 2020-10-16 16:07:27 PDT
Reverted r268178 for reason:

This reverts commit r268178 because it caused a test failure.

Committed r268619: <https://trac.webkit.org/changeset/268619>
Comment 7 ssggg2015 2020-10-18 23:22:08 PDT
Comment on attachment 410810 [details]
Patch

>Subversion Revision: 268138
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
>index b79f977536dae32756d2f6d54e2beede7f28991e..d90086924a8b0add06e14ee683c99b77924916c0 100644
>--- a/Source/WebCore/ChangeLog
>+++ b/Source/WebCore/ChangeLog
>@@ -1,3 +1,18 @@
>+2020-10-07  Rob Buis  <rbuis@igalia.com>
>+
>+        Fix image-loading-lazy-multiple-times.html
>+        https://bugs.webkit.org/show_bug.cgi?id=216979
>+
>+        Reviewed by NOBODY (OOPS!).
>+
>+        Once an image has been lazy loaded, it should be possible
>+        to trigger a new lazy load through relevant mutations.
>+
>+        Test: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-multiple-times.html
>+
>+        * loader/ImageLoader.cpp:
>+        (WebCore::ImageLoader::updateFromElement):
>+
> 2020-10-07  Noam Rosenthal  <noam@webkit.org>
> 
>         clip-path: path() ignores page zooming (Command-+)
>diff --git a/Source/WebCore/loader/ImageLoader.cpp b/Source/WebCore/loader/ImageLoader.cpp
>index 6c065d7813b194ee95f61b69041e1401bdb3ce0f..4899c2777981bd84f0a7433cb9d7f667bbe3959d 100644
>--- a/Source/WebCore/loader/ImageLoader.cpp
>+++ b/Source/WebCore/loader/ImageLoader.cpp
>@@ -206,7 +206,7 @@ void ImageLoader::updateFromElement(RelevantMutation relevantMutation)
>             document.cachedResourceLoader().m_documentResources.set(newImage->url().string(), newImage.get());
>             document.cachedResourceLoader().setAutoLoadImages(autoLoadOtherImages);
>         } else {
>-            if (m_lazyImageLoadState == LazyImageLoadState::None && isImageElement) {
>+            if ((m_lazyImageLoadState == LazyImageLoadState::None || m_lazyImageLoadState == LazyImageLoadState::FullImage) && isImageElement) {
>                 auto& imageElement = downcast<HTMLImageElement>(element());
>                 if (imageElement.isLazyLoadable() && document.settings().lazyImageLoadingEnabled()) {
>                     m_lazyImageLoadState = LazyImageLoadState::Deferred;
>diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog
>index b62ef007ce4d1e92ec6e108daac7983d6e85d44e..1c6cc4b8816972ecdf289a075766cc87806e7e67 100644
>--- a/LayoutTests/imported/w3c/ChangeLog
>+++ b/LayoutTests/imported/w3c/ChangeLog
>@@ -1,3 +1,14 @@
>+2020-10-07  Rob Buis  <rbuis@igalia.com>
>+
>+        Fix image-loading-lazy-multiple-times.html
>+        https://bugs.webkit.org/show_bug.cgi?id=216979
>+
>+        Reviewed by NOBODY (OOPS!).
>+
>+        Add improved test result.
>+
>+        * web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-multiple-times-expected.txt:
>+
> 2020-10-07  Noam Rosenthal  <noam@webkit.org>
> 
>         clip-path: path() ignores page zooming (Command-+)
>diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-multiple-times-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-multiple-times-expected.txt
>index 33d738a925ea916824b7d5c00d4879db48be469c..830329d72649758bae5dd4c2b8e11f8d7e4136f2 100644
>--- a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-multiple-times-expected.txt
>+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-multiple-times-expected.txt
>@@ -1,4 +1,4 @@
> 
> 
>-FAIL Images with loading='lazy' can be lazy loaded multiple times assert_unreached: The loading=lazy below-viewport image should lazily load its second image, and not load it eagerly when the `src` attribute is changed Reached unreachable code
>+PASS Images with loading='lazy' can be lazy loaded multiple times
>