Changeset 266408 in webkit


Ignore:
Timestamp:
Sep 1, 2020 12:24:21 PM (4 years ago)
Author:
commit-queue@webkit.org
Message:

Convert runtime flag to setting for lazy image loading
https://bugs.webkit.org/show_bug.cgi?id=215610

Patch by Rob Buis <rbuis@igalia.com> on 2020-09-01
Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Remove changes done to the lazy image loading tests as we enable the setting in testharnessreport.js.
The new expected results are improvements.

  • web-platform-tests/html/semantics/embedded-content/the-img-element/below-viewport-image-loading-lazy-load-event.html:
  • web-platform-tests/html/semantics/embedded-content/the-img-element/disconnected-image-loading-lazy.html:
  • web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-eager.html:
  • web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-base-url-2-expected.txt:
  • web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-base-url-expected.txt:
  • web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-below-viewport-dynamic.html:
  • web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-crossorigin-change.sub.html:
  • web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-cross-origin-iframe-001.sub-expected.txt:
  • web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-cross-origin-iframe-002.sub-expected.txt:
  • web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-script-disabled-iframe.html:
  • web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-viewport-dynamic.html:
  • web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-load-event.html:
  • web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-move-document.html:
  • web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-move-into-script-disabled-iframe.html:
  • web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-multicol.html:
  • web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-multiple-times-expected.txt:
  • web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-referrerpolicy-change.sub.html:
  • web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-relevant-mutations-expected.txt:
  • web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-srcset-expected.txt:
  • web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-to-eager-expected.txt:
  • web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy.html:
  • web-platform-tests/html/semantics/embedded-content/the-img-element/invisible-image.html:
  • web-platform-tests/html/semantics/embedded-content/the-img-element/move-element-and-scroll.html:
  • web-platform-tests/html/semantics/embedded-content/the-img-element/not-rendered-below-viewport-image-loading-lazy.html:
  • web-platform-tests/html/semantics/embedded-content/the-img-element/not-rendered-image-loading-lazy.html:
  • web-platform-tests/html/semantics/embedded-content/the-img-element/picture-loading-lazy.html:
  • web-platform-tests/html/semantics/embedded-content/the-img-element/remove-element-and-scroll.html:

Source/WebCore:

Convert runtime flag to setting for lazy image loading. Settings are
preferred over RuntimeEnabledFeatures as they are not global singletons
and are automatically accessible in layout tests via InternalSettingsGenerated.

  • loader/ImageLoader.cpp:

Source/WebKit:

Remove lazy image loading runtime flag.

  • UIProcess/API/C/WKPreferences.cpp:

(WKPreferencesSetLazyImageLoadingEnabled): Deleted.
(WKPreferencesGetLazyImageLoadingEnabled): Deleted.

  • UIProcess/API/C/WKPreferencesRefPrivate.h:

Tools:

Remove lazy image loading runtime flag.

  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::resetPreferencesToConsistentValues):
(WTR::updateTestOptionsFromTestHeader):

  • WebKitTestRunner/TestOptions.h:

(WTR::TestOptions::hasSameInitializationOptions const):

LayoutTests:

Enable lazy image loading setting in resources/testharnessreport.js. Update test expectations
and adjust the tests in http/tests/lazyload/ to enable the setting. Fow WK1 list more tests
that should be skipped.

  • TestExpectations:
  • http/tests/lazyload/attribute.html:
  • http/tests/lazyload/js-image.html:
  • http/tests/lazyload/lazy-image-load-in-iframes-scripting-disabled.html:
  • http/tests/lazyload/lazy-image-load-in-iframes-scripting-enabled.html:
  • http/tests/lazyload/lazy.html:
  • platform/gtk/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
  • platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
  • platform/mac-wk1/TestExpectations:
  • platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
  • platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
  • resources/testharnessreport.js:
Location:
trunk
Files:
51 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r266403 r266408  
     12020-09-01  Rob Buis  <rbuis@igalia.com>
     2
     3        Convert runtime flag to setting for lazy image loading
     4        https://bugs.webkit.org/show_bug.cgi?id=215610
     5
     6        Reviewed by Youenn Fablet.
     7
     8        Enable lazy image loading setting in resources/testharnessreport.js. Update test expectations
     9        and adjust the tests in http/tests/lazyload/ to enable the setting. Fow WK1 list more tests
     10        that should be skipped.
     11
     12
     13        * TestExpectations:
     14        * http/tests/lazyload/attribute.html:
     15        * http/tests/lazyload/js-image.html:
     16        * http/tests/lazyload/lazy-image-load-in-iframes-scripting-disabled.html:
     17        * http/tests/lazyload/lazy-image-load-in-iframes-scripting-enabled.html:
     18        * http/tests/lazyload/lazy.html:
     19        * platform/gtk/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
     20        * platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
     21        * platform/mac-wk1/TestExpectations:
     22        * platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
     23        * platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
     24        * platform/wpe/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
     25        * resources/testharnessreport.js:
     26
    1272020-09-01  Antti Koivisto  <antti@apple.com>
    228
  • trunk/LayoutTests/TestExpectations

    r266396 r266408  
    551551imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/adopt-from-image-document.html [ ImageOnlyFailure ]
    552552imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-slow-aspect-ratio.html [ ImageOnlyFailure ]
     553imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-slow.html [ Skip ]
    553554imported/w3c/web-platform-tests/html/semantics/forms/the-option-element/dynamic-content-change-rendering.html [ ImageOnlyFailure ]
    554555imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/reset-algorithm-rendering.html [ ImageOnlyFailure ]
     
    575576imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio-lazy.tentative.html [ Failure Pass ]
    576577imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-to-eager.tentative.html [ Failure Pass ]
    577 imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-to-eager.html [ Failure Pass ]
    578578imported/w3c/web-platform-tests/html/semantics/forms/autofocus/update-the-rendering.html [ Failure Pass ]
    579579imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/muted-errors.sub.html [ Failure Pass ]
  • trunk/LayoutTests/http/tests/lazyload/attribute.html

    r266358 r266408  
    1 <!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
     1<!DOCTYPE html>
    22<script src="/resources/testharness.js"></script>
    33<script src="/resources/testharnessreport.js"></script>
    44<script src="placeholder.js"></script>
     5
     6<script>
     7  if (window.internals)
     8    internals.settings.setLazyImageLoadingEnabled(true);
     9</script>
    510
    611<body>
  • trunk/LayoutTests/http/tests/lazyload/js-image.html

    r266358 r266408  
    1 <!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
     1<!DOCTYPE html>
    22<script src="/resources/testharness.js"></script>
    33<script src="/resources/testharnessreport.js"></script>
     
    99
    1010<script>
     11  if (window.internals)
     12    internals.settings.setLazyImageLoadingEnabled(true);
    1113  async_test(function(t) {
    1214    const img = new Image();
  • trunk/LayoutTests/http/tests/lazyload/lazy-image-load-in-iframes-scripting-disabled.html

    r266358 r266408  
    1 <!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
     1<!DOCTYPE html>
    22<script src="/resources/testharness.js"></script>
    33<script src="/resources/testharnessreport.js"></script>
    44<script src="placeholder.js"></script>
    55<script>
     6    if (window.internals)
     7        internals.settings.setLazyImageLoadingEnabled(true);
    68    var t = async_test("Verify that iframe's with scripting off disallow lazy image loading.");
    79    function finish() {
  • trunk/LayoutTests/http/tests/lazyload/lazy-image-load-in-iframes-scripting-enabled.html

    r266358 r266408  
    1 <!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
     1<!DOCTYPE html>
    22<script src="/resources/testharness.js"></script>
    33<script src="/resources/testharnessreport.js"></script>
    44<script src="placeholder.js"></script>
    55<script>
     6    if (window.internals)
     7        internals.settings.setLazyImageLoadingEnabled(true);
    68    var t = async_test("Verify that iframe's with sandbox='allow-scripts' allow lazy image loading.");
    79    function finish() {
  • trunk/LayoutTests/http/tests/lazyload/lazy.html

    r266358 r266408  
    1 <!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
     1<!DOCTYPE html>
    22<script src="/resources/testharness.js"></script>
    33<script src="/resources/testharnessreport.js"></script>
    44<script src="placeholder.js"></script>
     5
     6<script>
     7  if (window.internals)
     8    internals.settings.setLazyImageLoadingEnabled(true);
     9</script>
    510
    611<body>
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r266399 r266408  
     12020-09-01  Rob Buis  <rbuis@igalia.com>
     2
     3        Convert runtime flag to setting for lazy image loading
     4        https://bugs.webkit.org/show_bug.cgi?id=215610
     5
     6        Reviewed by Youenn Fablet.
     7
     8        Remove changes done to the lazy image loading tests as we enable the setting in testharnessreport.js.
     9        The new expected results are improvements.
     10
     11        * web-platform-tests/html/semantics/embedded-content/the-img-element/below-viewport-image-loading-lazy-load-event.html:
     12        * web-platform-tests/html/semantics/embedded-content/the-img-element/disconnected-image-loading-lazy.html:
     13        * web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-eager.html:
     14        * web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-base-url-2-expected.txt:
     15        * web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-base-url-expected.txt:
     16        * web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-below-viewport-dynamic.html:
     17        * web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-crossorigin-change.sub.html:
     18        * web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-cross-origin-iframe-001.sub-expected.txt:
     19        * web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-cross-origin-iframe-002.sub-expected.txt:
     20        * web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-script-disabled-iframe.html:
     21        * web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-viewport-dynamic.html:
     22        * web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-load-event.html:
     23        * web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-move-document.html:
     24        * web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-move-into-script-disabled-iframe.html:
     25        * web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-multicol.html:
     26        * web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-multiple-times-expected.txt:
     27        * web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-referrerpolicy-change.sub.html:
     28        * web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-relevant-mutations-expected.txt:
     29        * web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-srcset-expected.txt:
     30        * web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-to-eager-expected.txt:
     31        * web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy.html:
     32        * web-platform-tests/html/semantics/embedded-content/the-img-element/invisible-image.html:
     33        * web-platform-tests/html/semantics/embedded-content/the-img-element/move-element-and-scroll.html:
     34        * web-platform-tests/html/semantics/embedded-content/the-img-element/not-rendered-below-viewport-image-loading-lazy.html:
     35        * web-platform-tests/html/semantics/embedded-content/the-img-element/not-rendered-image-loading-lazy.html:
     36        * web-platform-tests/html/semantics/embedded-content/the-img-element/picture-loading-lazy.html:
     37        * web-platform-tests/html/semantics/embedded-content/the-img-element/remove-element-and-scroll.html:
     38
    1392020-09-01  Alex Christensen  <achristensen@webkit.org>
    240
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/below-viewport-image-loading-lazy-load-event.html

    r266358 r266408  
    1 <!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
     1<!DOCTYPE html>
    22<head>
    33  <title>Below-viewport loading=lazy images do not block the window load event
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/disconnected-image-loading-lazy.html

    r266358 r266408  
    1 <!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
     1<!DOCTYPE html>
    22<script src="/resources/testharness.js"></script>
    33<script src="/resources/testharnessreport.js"></script>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-eager.html

    r266358 r266408  
    1 <!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
     1<!DOCTYPE html>
    22<head>
    33  <title>Images with loading='eager' load immediately regardless of their
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-base-url-2-expected.txt

    r266358 r266408  
    11
    22
    3 FAIL When a loading=lazy image is loaded, it loads relative to the document's base URL computed at parse-time. assert_true: Below-viewport loading=lazy images do not block the window load event expected true got false
     3PASS When a loading=lazy image is loaded, it loads relative to the document's base URL computed at parse-time.
    44
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-base-url-expected.txt

    r266358 r266408  
    11
    22
    3 FAIL When a loading=lazy image is loaded, it loads relative to the document's base URL computed at parse-time. assert_true: Below-viewport loading=lazy images do not block the window load event expected true got false
     3PASS When a loading=lazy image is loaded, it loads relative to the document's base URL computed at parse-time.
    44
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-below-viewport-dynamic.html

    r266358 r266408  
    1 <!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
     1<!DOCTYPE html>
    22<head>
    33  <title>Below viewport images with loading='lazy' and changed to
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-crossorigin-change.sub.html

    r266358 r266408  
    1 <!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
     1<!DOCTYPE html>
    22<head>
    33  <title>Deferred images with loading='lazy' use the latest crossorigin attribute</title>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-cross-origin-iframe-001.sub-expected.txt

    r266358 r266408  
    11
    22
    3 FAIL A below-viewport loading=lazy image in a cross origin iframe loads only
    4        when scrolled into viewport assert_equals: The loading=lazy image should not block the iframe's load event expected "window_loaded" but got "image_loaded"
     3PASS A below-viewport loading=lazy image in a cross origin iframe loads only
     4       when scrolled into viewport
    55
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-cross-origin-iframe-002.sub-expected.txt

    r266358 r266408  
    11
    22
    3 FAIL A loading=lazy image in a below-viewport cross-origin iframe loads only
    4        when the cross-origin iframe is scrolled into view assert_equals: The loading=lazy image should not block the iframe's load event expected "window_loaded" but got "image_loaded"
     3PASS A loading=lazy image in a below-viewport cross-origin iframe loads only
     4       when the cross-origin iframe is scrolled into view
    55
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-script-disabled-iframe.html

    r266358 r266408  
    1 <!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
     1<!DOCTYPE html>
    22<head>
    33<title>Images with loading='lazy' in script disabled iframe are not handled
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-viewport-dynamic.html

    r266358 r266408  
    1 <!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
     1<!DOCTYPE html>
    22<head>
    33  <title>In viewport images with loading='lazy' and changed to loading='eager'
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-load-event.html

    r266358 r266408  
    1 <!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
     1<!DOCTYPE html>
    22<head>
    33  <title>In-viewport loading=lazy images do not block the window load event</title>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-move-document.html

    r266358 r266408  
    1 <!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
     1<!DOCTYPE html>
    22<head>
    33<title>Moving loading='lazy' image into another top level document</title>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-move-into-script-disabled-iframe.html

    r266358 r266408  
    1 <!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
     1<!DOCTYPE html>
    22<head>
    33<title>A loading='lazy' image starts loading when the element is moved into
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-multicol.html

    r266358 r266408  
    1 <!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
     1<!DOCTYPE html>
    22<head>
    33  <title>Images with loading='lazy' load when in the viewport</title>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-multiple-times-expected.txt

    r266358 r266408  
    11
    22
    3 FAIL Images with loading='lazy' can be lazy loaded multiple times assert_true: The loading=lazy below-viewport image should not block the window load event expected true got false
     3FAIL 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
    44
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-referrerpolicy-change.sub.html

    r266358 r266408  
    1 <!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
     1<!DOCTYPE html>
    22<head>
    33  <title>Deferred loading=lazy images are fetched with the latest
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-relevant-mutations-expected.txt

    r266358 r266408  
    1 CONSOLE MESSAGE: Error: assert_false: below-viewport-1 image should never load expected false got true
    2    
     1   
    32
    4 Harness Error (FAIL), message = Error: assert_false: below-viewport-1 image should never load expected false got true
     3PASS Images are lazyloaded
     4PASS Image referrerPolicy mutation does not cause deferred loading=lazy images to be fetched
     5PASS Image crossOrigin mutation does not cause deferred loading=lazy images to be fetched
     6PASS Image src mutation does not cause deferred loading=lazy images to be fetched
    57
    6 TIMEOUT Images are lazyloaded Test timed out
    7 NOTRUN Image referrerPolicy mutation does not cause deferred loading=lazy images to be fetched
    8 NOTRUN Image crossOrigin mutation does not cause deferred loading=lazy images to be fetched
    9 NOTRUN Image src mutation does not cause deferred loading=lazy images to be fetched
    10 
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-slow.html

    r266358 r266408  
    55  <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-img-element">
    66
     7  <script src="/resources/testharness.js"></script>
     8  <script src="/resources/testharnessreport.js"></script>
    79  <script src="/common/reftest-wait.js"></script>
    810  <img id=target loading="lazy"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-srcset-expected.txt

    r266358 r266408  
    11 
    22
    3 FAIL loading='lazy' image with srcset assert_equals: lazy-load images with srcset shouldn't be loaded yet expected 0 but got 2
     3PASS loading='lazy' image with srcset
    44
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-to-eager-expected.txt

    r266358 r266408  
    11 
    22
    3 FAIL Below-viewport images with loading='lazy' load when set to loading='eager' or the `loading` attribute is removed assert_unreached: #img_1 should not load before the window load event Reached unreachable code
     3PASS Below-viewport images with loading='lazy' load when set to loading='eager' or the `loading` attribute is removed
    44
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy.html

    r266358 r266408  
    1 <!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
     1<!DOCTYPE html>
    22<head>
    33  <title>Images with loading='lazy' load only when in the viewport</title>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/invisible-image.html

    r266358 r266408  
    1 <!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
     1<!DOCTYPE html>
    22<head>
    33  <title>Test that below-viewport invisible images that are not marked
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/move-element-and-scroll.html

    r266358 r266408  
    1 <!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
     1<!DOCTYPE html>
    22<head>
    33  <title>Images with loading='lazy' load being moved to another document
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/not-rendered-below-viewport-image-loading-lazy.html

    r266358 r266408  
    1 <!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
     1<!DOCTYPE html>
    22<head>
    33  <title>Below-viewport loading=lazy not-rendered images should never load,
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/not-rendered-image-loading-lazy.html

    r266358 r266408  
    1 <!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
     1<!DOCTYPE html>
    22<head>
    33  <title>In-viewport loading=lazy not-rendered images should never load</title>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/picture-loading-lazy.html

    r266358 r266408  
    1 <!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
     1<!DOCTYPE html>
    22<head>
    33  <title>Images with loading='lazy' in picture elements load when near the viewport</title>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/remove-element-and-scroll.html

    r266358 r266408  
    1 <!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
     1<!DOCTYPE html>
    22<head>
    33  <title>Images with loading='lazy' load being removed and then scrolled to</title>
  • trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt

    r266358 r266408  
    901901PASS HTMLImageElement interface: attribute referrerPolicy
    902902PASS HTMLImageElement interface: attribute decoding
    903 FAIL HTMLImageElement interface: attribute loading assert_true: The prototype object must have a property "loading" expected true got false
     903PASS HTMLImageElement interface: attribute loading
    904904PASS HTMLImageElement interface: operation decode()
    905905PASS HTMLImageElement interface: attribute name
     
    927927PASS HTMLImageElement interface: document.createElement("img") must inherit property "referrerPolicy" with the proper type
    928928PASS HTMLImageElement interface: document.createElement("img") must inherit property "decoding" with the proper type
    929 FAIL HTMLImageElement interface: document.createElement("img") must inherit property "loading" with the proper type assert_inherits: property "loading" not found in prototype chain
     929PASS HTMLImageElement interface: document.createElement("img") must inherit property "loading" with the proper type
    930930PASS HTMLImageElement interface: document.createElement("img") must inherit property "decode()" with the proper type
    931931PASS HTMLImageElement interface: document.createElement("img") must inherit property "name" with the proper type
     
    953953PASS HTMLImageElement interface: new Image() must inherit property "referrerPolicy" with the proper type
    954954PASS HTMLImageElement interface: new Image() must inherit property "decoding" with the proper type
    955 FAIL HTMLImageElement interface: new Image() must inherit property "loading" with the proper type assert_inherits: property "loading" not found in prototype chain
     955PASS HTMLImageElement interface: new Image() must inherit property "loading" with the proper type
    956956PASS HTMLImageElement interface: new Image() must inherit property "decode()" with the proper type
    957957PASS HTMLImageElement interface: new Image() must inherit property "name" with the proper type
  • trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt

    r266358 r266408  
    901901PASS HTMLImageElement interface: attribute referrerPolicy
    902902PASS HTMLImageElement interface: attribute decoding
    903 FAIL HTMLImageElement interface: attribute loading assert_true: The prototype object must have a property "loading" expected true got false
     903PASS HTMLImageElement interface: attribute loading
    904904PASS HTMLImageElement interface: operation decode()
    905905PASS HTMLImageElement interface: attribute name
     
    927927PASS HTMLImageElement interface: document.createElement("img") must inherit property "referrerPolicy" with the proper type
    928928PASS HTMLImageElement interface: document.createElement("img") must inherit property "decoding" with the proper type
    929 FAIL HTMLImageElement interface: document.createElement("img") must inherit property "loading" with the proper type assert_inherits: property "loading" not found in prototype chain
     929PASS HTMLImageElement interface: document.createElement("img") must inherit property "loading" with the proper type
    930930PASS HTMLImageElement interface: document.createElement("img") must inherit property "decode()" with the proper type
    931931PASS HTMLImageElement interface: document.createElement("img") must inherit property "name" with the proper type
     
    953953PASS HTMLImageElement interface: new Image() must inherit property "referrerPolicy" with the proper type
    954954PASS HTMLImageElement interface: new Image() must inherit property "decoding" with the proper type
    955 FAIL HTMLImageElement interface: new Image() must inherit property "loading" with the proper type assert_inherits: property "loading" not found in prototype chain
     955PASS HTMLImageElement interface: new Image() must inherit property "loading" with the proper type
    956956PASS HTMLImageElement interface: new Image() must inherit property "decode()" with the proper type
    957957PASS HTMLImageElement interface: new Image() must inherit property "name" with the proper type
  • trunk/LayoutTests/platform/mac-wk1/TestExpectations

    r266382 r266408  
    180180imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/picture-loading-lazy.html [ Skip ]
    181181imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/remove-element-and-scroll.html [ Skip ]
     182imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/invisible-image.html [ Skip ]
     183imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-to-eager.html [ Skip ]
    182184
    183185# testRunner.queueLoad() does not support loading data URLs in Mac WK1
  • trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt

    r266358 r266408  
    901901PASS HTMLImageElement interface: attribute referrerPolicy
    902902PASS HTMLImageElement interface: attribute decoding
    903 FAIL HTMLImageElement interface: attribute loading assert_true: The prototype object must have a property "loading" expected true got false
     903PASS HTMLImageElement interface: attribute loading
    904904PASS HTMLImageElement interface: operation decode()
    905905PASS HTMLImageElement interface: attribute name
     
    927927PASS HTMLImageElement interface: document.createElement("img") must inherit property "referrerPolicy" with the proper type
    928928PASS HTMLImageElement interface: document.createElement("img") must inherit property "decoding" with the proper type
    929 FAIL HTMLImageElement interface: document.createElement("img") must inherit property "loading" with the proper type assert_inherits: property "loading" not found in prototype chain
     929PASS HTMLImageElement interface: document.createElement("img") must inherit property "loading" with the proper type
    930930PASS HTMLImageElement interface: document.createElement("img") must inherit property "decode()" with the proper type
    931931PASS HTMLImageElement interface: document.createElement("img") must inherit property "name" with the proper type
     
    953953PASS HTMLImageElement interface: new Image() must inherit property "referrerPolicy" with the proper type
    954954PASS HTMLImageElement interface: new Image() must inherit property "decoding" with the proper type
    955 FAIL HTMLImageElement interface: new Image() must inherit property "loading" with the proper type assert_inherits: property "loading" not found in prototype chain
     955PASS HTMLImageElement interface: new Image() must inherit property "loading" with the proper type
    956956PASS HTMLImageElement interface: new Image() must inherit property "decode()" with the proper type
    957957PASS HTMLImageElement interface: new Image() must inherit property "name" with the proper type
  • trunk/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt

    r266358 r266408  
    901901PASS HTMLImageElement interface: attribute referrerPolicy
    902902PASS HTMLImageElement interface: attribute decoding
    903 FAIL HTMLImageElement interface: attribute loading assert_true: The prototype object must have a property "loading" expected true got false
     903PASS HTMLImageElement interface: attribute loading
    904904PASS HTMLImageElement interface: operation decode()
    905905PASS HTMLImageElement interface: attribute name
     
    927927PASS HTMLImageElement interface: document.createElement("img") must inherit property "referrerPolicy" with the proper type
    928928PASS HTMLImageElement interface: document.createElement("img") must inherit property "decoding" with the proper type
    929 FAIL HTMLImageElement interface: document.createElement("img") must inherit property "loading" with the proper type assert_inherits: property "loading" not found in prototype chain
     929PASS HTMLImageElement interface: document.createElement("img") must inherit property "loading" with the proper type
    930930PASS HTMLImageElement interface: document.createElement("img") must inherit property "decode()" with the proper type
    931931PASS HTMLImageElement interface: document.createElement("img") must inherit property "name" with the proper type
     
    953953PASS HTMLImageElement interface: new Image() must inherit property "referrerPolicy" with the proper type
    954954PASS HTMLImageElement interface: new Image() must inherit property "decoding" with the proper type
    955 FAIL HTMLImageElement interface: new Image() must inherit property "loading" with the proper type assert_inherits: property "loading" not found in prototype chain
     955PASS HTMLImageElement interface: new Image() must inherit property "loading" with the proper type
    956956PASS HTMLImageElement interface: new Image() must inherit property "decode()" with the proper type
    957957PASS HTMLImageElement interface: new Image() must inherit property "name" with the proper type
  • trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt

    r266358 r266408  
    901901PASS HTMLImageElement interface: attribute referrerPolicy
    902902PASS HTMLImageElement interface: attribute decoding
    903 FAIL HTMLImageElement interface: attribute loading assert_true: The prototype object must have a property "loading" expected true got false
     903PASS HTMLImageElement interface: attribute loading
    904904PASS HTMLImageElement interface: operation decode()
    905905PASS HTMLImageElement interface: attribute name
     
    927927PASS HTMLImageElement interface: document.createElement("img") must inherit property "referrerPolicy" with the proper type
    928928PASS HTMLImageElement interface: document.createElement("img") must inherit property "decoding" with the proper type
    929 FAIL HTMLImageElement interface: document.createElement("img") must inherit property "loading" with the proper type assert_inherits: property "loading" not found in prototype chain
     929PASS HTMLImageElement interface: document.createElement("img") must inherit property "loading" with the proper type
    930930PASS HTMLImageElement interface: document.createElement("img") must inherit property "decode()" with the proper type
    931931PASS HTMLImageElement interface: document.createElement("img") must inherit property "name" with the proper type
     
    953953PASS HTMLImageElement interface: new Image() must inherit property "referrerPolicy" with the proper type
    954954PASS HTMLImageElement interface: new Image() must inherit property "decoding" with the proper type
    955 FAIL HTMLImageElement interface: new Image() must inherit property "loading" with the proper type assert_inherits: property "loading" not found in prototype chain
     955PASS HTMLImageElement interface: new Image() must inherit property "loading" with the proper type
    956956PASS HTMLImageElement interface: new Image() must inherit property "decode()" with the proper type
    957957PASS HTMLImageElement interface: new Image() must inherit property "name" with the proper type
  • trunk/LayoutTests/resources/testharnessreport.js

    r266358 r266408  
    3131        if (window.webkitAudioPannerNode && !window.PannerNode)
    3232            Object.defineProperty(self, "PannerNode", Object.getOwnPropertyDescriptor(self, "webkitAudioPannerNode"));
    33         if (self.internals)
     33        if (self.internals) {
    3434            internals.settings.setLazyIframeLoadingEnabled(location.pathname.indexOf('iframe-loading-lazy') !== -1);
     35            internals.settings.setLazyImageLoadingEnabled(true);
     36        }
    3537    }
    3638
  • trunk/Source/WebCore/ChangeLog

    r266407 r266408  
     12020-09-01  Rob Buis  <rbuis@igalia.com>
     2
     3        Convert runtime flag to setting for lazy image loading
     4        https://bugs.webkit.org/show_bug.cgi?id=215610
     5
     6        Reviewed by Youenn Fablet.
     7
     8        Convert runtime flag to setting for lazy image loading. Settings are
     9        preferred over RuntimeEnabledFeatures as they are not global singletons
     10        and are automatically accessible in layout tests via InternalSettingsGenerated.
     11
     12        * loader/ImageLoader.cpp:
     13
    1142020-09-01  Tim Horton  <timothy_horton@apple.com>
    215
  • trunk/Source/WebCore/loader/ImageLoader.cpp

    r266360 r266408  
    4444#include "RenderImage.h"
    4545#include "RenderSVGImage.h"
    46 #include "RuntimeEnabledFeatures.h"
     46#include "Settings.h"
    4747#include <wtf/NeverDestroyed.h>
    4848
  • trunk/Source/WebKit/ChangeLog

    r266407 r266408  
     12020-09-01  Rob Buis  <rbuis@igalia.com>
     2
     3        Convert runtime flag to setting for lazy image loading
     4        https://bugs.webkit.org/show_bug.cgi?id=215610
     5
     6        Reviewed by Youenn Fablet.
     7
     8        Remove lazy image loading runtime flag.
     9
     10        * UIProcess/API/C/WKPreferences.cpp:
     11        (WKPreferencesSetLazyImageLoadingEnabled): Deleted.
     12        (WKPreferencesGetLazyImageLoadingEnabled): Deleted.
     13        * UIProcess/API/C/WKPreferencesRefPrivate.h:
     14
    1152020-09-01  Tim Horton  <timothy_horton@apple.com>
    216
  • trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp

    r266358 r266408  
    22312231}
    22322232
    2233 void WKPreferencesSetLazyImageLoadingEnabled(WKPreferencesRef preferencesRef, bool flag)
    2234 {
    2235     toImpl(preferencesRef)->setLazyImageLoadingEnabled(flag);
    2236 }
    2237 
    2238 bool WKPreferencesGetLazyImageLoadingEnabled(WKPreferencesRef preferencesRef)
    2239 {
    2240     return toImpl(preferencesRef)->lazyImageLoadingEnabled();
    2241 }
    2242 
    22432233bool WKPreferencesGetRemotePlaybackEnabled(WKPreferencesRef preferencesRef)
    22442234{
  • trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h

    r266358 r266408  
    616616WK_EXPORT bool WKPreferencesGetReferrerPolicyAttributeEnabled(WKPreferencesRef);
    617617
    618 // Defaults to false
    619 WK_EXPORT void WKPreferencesSetLazyImageLoadingEnabled(WKPreferencesRef, bool flag);
    620 WK_EXPORT bool WKPreferencesGetLazyImageLoadingEnabled(WKPreferencesRef);
    621 
    622618#ifdef __cplusplus
    623619}
  • trunk/Tools/ChangeLog

    r266399 r266408  
     12020-09-01  Rob Buis  <rbuis@igalia.com>
     2
     3        Convert runtime flag to setting for lazy image loading
     4        https://bugs.webkit.org/show_bug.cgi?id=215610
     5
     6        Reviewed by Youenn Fablet.
     7
     8        Remove lazy image loading runtime flag.
     9
     10        * WebKitTestRunner/TestController.cpp:
     11        (WTR::TestController::resetPreferencesToConsistentValues):
     12        (WTR::updateTestOptionsFromTestHeader):
     13        * WebKitTestRunner/TestOptions.h:
     14        (WTR::TestOptions::hasSameInitializationOptions const):
     15
    1162020-09-01  Alex Christensen  <achristensen@webkit.org>
    217
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r266358 r266408  
    922922    WKPreferencesSetPunchOutWhiteBackgroundsInDarkMode(preferences, options.punchOutWhiteBackgroundsInDarkMode);
    923923    WKPreferencesSetPageCacheEnabled(preferences, options.enableBackForwardCache);
    924     WKPreferencesSetLazyImageLoadingEnabled(preferences, options.enableLazyImageLoading);
    925924
    926925    static WKStringRef defaultTextEncoding = WKStringCreateWithUTF8CString("ISO-8859-1");
     
    15521551        else if (key == "enableBackForwardCache")
    15531552            testOptions.enableBackForwardCache = parseBooleanTestHeaderValue(value);
    1554         else if (key == "enableLazyImageLoading")
    1555             testOptions.enableLazyImageLoading = parseBooleanTestHeaderValue(value);
    15561553        else if (key == "allowsLinkPreview")
    15571554            testOptions.allowsLinkPreview = parseBooleanTestHeaderValue(value);
  • trunk/Tools/WebKitTestRunner/TestOptions.h

    r266358 r266408  
    9797    bool enableAppNap { false };
    9898    bool enableBackForwardCache { false };
    99     bool enableLazyImageLoading { false };
    10099    bool allowsLinkPreview { true };
    101100    bool enableCaptureVideoInUIProcess { false };
     
    166165            || enableAppNap != options.enableAppNap
    167166            || enableBackForwardCache != options.enableBackForwardCache
    168             || enableLazyImageLoading != options.enableLazyImageLoading
    169167            || allowsLinkPreview != options.allowsLinkPreview
    170168            || enableCaptureVideoInUIProcess != options.enableCaptureVideoInUIProcess
Note: See TracChangeset for help on using the changeset viewer.