Skip to content

Commit 56aa19b

Browse files
rwlbuiswebkit-commit-queue
authored andcommitted
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-15 Reviewed by Youenn Fablet. LayoutTests/imported/w3c: Remove the webkit-test-runner directive additions done to the lazy image loading tests. 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-slow.html: * 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: 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: * http/tests/lazyload/resources/lazy-load-in-iframe.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-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: Canonical link: https://commits.webkit.org/229365@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267083 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent d221873 commit 56aa19b

50 files changed

Lines changed: 183 additions & 77 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

LayoutTests/ChangeLog

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
2020-09-15 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+
Update test expectations and adjust the tests in http/tests/lazyload/ to
9+
enable the setting. Fow WK1 list more tests that should be skipped.
10+
11+
* TestExpectations:
12+
* http/tests/lazyload/attribute.html:
13+
* http/tests/lazyload/js-image.html:
14+
* http/tests/lazyload/lazy-image-load-in-iframes-scripting-disabled.html:
15+
* http/tests/lazyload/lazy-image-load-in-iframes-scripting-enabled.html:
16+
* http/tests/lazyload/lazy.html:
17+
* http/tests/lazyload/resources/lazy-load-in-iframe.html:
18+
* platform/gtk/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
19+
* platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
20+
* platform/mac-wk1/TestExpectations:
21+
* platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
22+
* platform/wpe/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
23+
124
2020-09-14 Myles C. Maxfield <mmaxfield@apple.com>
225

326
[Apple Win] Migrate from FontPlatformDataWin.cpp to FontPlatformDataCoreText.cpp

LayoutTests/TestExpectations

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@ imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-eleme
550550
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/adopt-from-image-document.html [ ImageOnlyFailure ]
551551
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-slow-aspect-ratio.html [ ImageOnlyFailure ]
552552
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-slow.html [ ImageOnlyFailure ]
553+
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-subpixel-clip.html [ ImageOnlyFailure ]
553554
imported/w3c/web-platform-tests/html/semantics/forms/the-option-element/dynamic-content-change-rendering.html [ ImageOnlyFailure ]
554555
imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/reset-algorithm-rendering.html [ ImageOnlyFailure ]
555556
imported/w3c/web-platform-tests/html/semantics/forms/the-textarea-element/multiline-placeholder-cr.html [ ImageOnlyFailure ]
@@ -573,7 +574,6 @@ imported/w3c/web-platform-tests/html/browsers/windows/targeting-cross-origin-nes
573574
imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/reporting-to-endpoint.https.html [ Failure Pass ]
574575
imported/w3c/web-platform-tests/html/webappapis/update-rendering/child-document-raf-order.html [ Failure Pass ]
575576
imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio-lazy.tentative.html [ Failure Pass ]
576-
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-to-eager.html [ Failure Pass ]
577577
imported/w3c/web-platform-tests/html/semantics/forms/autofocus/update-the-rendering.html [ Failure Pass ]
578578
imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/muted-errors.sub.html [ Failure Pass ]
579579
imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies.any.html [ Failure Pass ]

LayoutTests/http/tests/lazyload/attribute.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
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

6+
<script>
7+
if (window.internals)
8+
internals.settings.setLazyImageLoadingEnabled(true);
9+
</script>
10+
611
<body>
712
<div style="height:10000px;"></div>
813
<img id="no_attribute_img" src='../loading/resources/base-image1.png'>

LayoutTests/http/tests/lazyload/js-image.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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>
@@ -8,6 +8,8 @@
88
</body>
99

1010
<script>
11+
if (window.internals)
12+
internals.settings.setLazyImageLoadingEnabled(true);
1113
async_test(function(t) {
1214
const img = new Image();
1315
img.onload = t.step_func_done(function() {

LayoutTests/http/tests/lazyload/lazy-image-load-in-iframes-scripting-disabled.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
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() {
810
assert_equals(is_image_fully_loaded(document.getElementById('sandboxedframe').contentWindow.document.getElementById('below_viewport')), true);

LayoutTests/http/tests/lazyload/lazy-image-load-in-iframes-scripting-enabled.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
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() {
810
assert_equals(is_image_fully_loaded(document.getElementById('sandboxedframe').contentWindow.document.getElementById('below_viewport')), false);

LayoutTests/http/tests/lazyload/lazy.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
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

6+
<script>
7+
if (window.internals)
8+
internals.settings.setLazyImageLoadingEnabled(true);
9+
</script>
10+
611
<body>
712
<img id="in_viewport" src='../loading/resources/base-image1.png'>
813
<div style="height:10000px;"></div>

LayoutTests/http/tests/lazyload/resources/lazy-load-in-iframe.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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>

LayoutTests/imported/w3c/ChangeLog

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,42 @@
1+
2020-09-15 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 the webkit-test-runner directive additions done to the lazy image loading tests.
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-slow.html:
30+
* web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-srcset-expected.txt:
31+
* web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-to-eager-expected.txt:
32+
* web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy.html:
33+
* web-platform-tests/html/semantics/embedded-content/the-img-element/invisible-image.html:
34+
* web-platform-tests/html/semantics/embedded-content/the-img-element/move-element-and-scroll.html:
35+
* web-platform-tests/html/semantics/embedded-content/the-img-element/not-rendered-below-viewport-image-loading-lazy.html:
36+
* web-platform-tests/html/semantics/embedded-content/the-img-element/not-rendered-image-loading-lazy.html:
37+
* web-platform-tests/html/semantics/embedded-content/the-img-element/picture-loading-lazy.html:
38+
* web-platform-tests/html/semantics/embedded-content/the-img-element/remove-element-and-scroll.html:
39+
140
2020-09-14 Chris Dumez <cdumez@apple.com>
241

342
Type of AnalyserNode's attributes should not be unrestricted double

LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/below-viewport-image-loading-lazy-load-event.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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
44
when scrolled into viewport</title>

0 commit comments

Comments
 (0)