Skip to content

Commit

Permalink
Main implementation for lazy image loading
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=200764

Patch by Rob Buis <[email protected]> on 2020-02-19
Reviewed by Frédéric Wang.

LayoutTests/imported/w3c:

When updating WPT tests in a lost minute change I forgot to add webkit-test-runner headers.
Remaining failures are tracked in https://bugs.webkit.org/show_bug.cgi?id=207902 and
https://bugs.webkit.org/show_bug.cgi?id=207901.

* web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-cross-origin-ifame-001.sub-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-cross-origin-ifame-001.sub.html:
* web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-cross-origin-ifame-002.sub-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-cross-origin-ifame-002.sub.html:
* web-platform-tests/html/semantics/embedded-content/the-img-element/original-base-url-applied-2-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/original-base-url-applied-2.html:
* web-platform-tests/html/semantics/embedded-content/the-img-element/original-base-url-applied-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/original-base-url-applied-iframe.html:
* web-platform-tests/html/semantics/embedded-content/the-img-element/original-base-url-applied.html:
* web-platform-tests/html/semantics/embedded-content/the-img-element/original-crossorigin-applied.sub-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/original-crossorigin-applied.sub.html:
* web-platform-tests/html/semantics/embedded-content/the-img-element/original-referrer-policy-applied.sub-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/original-referrer-policy-applied.sub.html:

LayoutTests:

Update test expectations to skip
image-loading-lazy-in-cross-origin-ifame-001.sub.html and
image-loading-lazy-in-cross-origin-ifame-002.sub.html.

* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:

Canonical link: https://commits.webkit.org/220912@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256916 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
rwlbuis authored and webkit-commit-queue committed Feb 19, 2020
1 parent 7f7e052 commit 0dc8011
Show file tree
Hide file tree
Showing 17 changed files with 57 additions and 19 deletions.
14 changes: 14 additions & 0 deletions LayoutTests/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
2020-02-19 Rob Buis <[email protected]>

Main implementation for lazy image loading
https://bugs.webkit.org/show_bug.cgi?id=200764

Reviewed by Frédéric Wang.

Update test expectations to skip
image-loading-lazy-in-cross-origin-ifame-001.sub.html and
image-loading-lazy-in-cross-origin-ifame-002.sub.html.

* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:

2020-02-19 Alejandro G. Castro <[email protected]>

REGRESSION(r188639): Several inspector tests timeout because they are slow after r188639
Expand Down
25 changes: 25 additions & 0 deletions LayoutTests/imported/w3c/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
2020-02-19 Rob Buis <[email protected]>

Main implementation for lazy image loading
https://bugs.webkit.org/show_bug.cgi?id=200764

Reviewed by Frédéric Wang.

When updating WPT tests in a lost minute change I forgot to add webkit-test-runner headers.
Remaining failures are tracked in https://bugs.webkit.org/show_bug.cgi?id=207902 and
https://bugs.webkit.org/show_bug.cgi?id=207901.

* web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-cross-origin-ifame-001.sub-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-cross-origin-ifame-001.sub.html:
* web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-cross-origin-ifame-002.sub-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-cross-origin-ifame-002.sub.html:
* web-platform-tests/html/semantics/embedded-content/the-img-element/original-base-url-applied-2-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/original-base-url-applied-2.html:
* web-platform-tests/html/semantics/embedded-content/the-img-element/original-base-url-applied-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/original-base-url-applied-iframe.html:
* web-platform-tests/html/semantics/embedded-content/the-img-element/original-base-url-applied.html:
* web-platform-tests/html/semantics/embedded-content/the-img-element/original-crossorigin-applied.sub-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/original-crossorigin-applied.sub.html:
* web-platform-tests/html/semantics/embedded-content/the-img-element/original-referrer-policy-applied.sub-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/original-referrer-policy-applied.sub.html:

2020-02-17 Chris Dumez <[email protected]>

Defer execution of async scripts until until the document is loaded
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@


Harness Error (TIMEOUT), message = null

TIMEOUT An image with loading='lazy' in cross origin iframe loads when it gets
visible by scrolling the iframe's scroll port Test timed out
PASS An image with loading='lazy' in cross origin iframe loads when it gets
visible by scrolling the iframe's scroll port

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
<head>
<title>An image with loading='lazy' in cross origin iframe loads when it gets
visible by scrolling the iframe's scroll port</title>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@


Harness Error (TIMEOUT), message = null

TIMEOUT An image with loading='lazy' in cross origin iframe loads when it gets
visible by scrolling the parent scroll container of the iframe Test timed out
PASS An image with loading='lazy' in cross origin iframe loads when it gets
visible by scrolling the parent scroll container of the iframe

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
<head>
<title>An image with loading='lazy' in cross origin iframe loads when it gets
visible by scrolling the parent scroll container of the iframe</title>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@


FAIL Deferred images with loading='lazy' use the original base URL specified at the parse time assert_true: Below-viewport loading=lazy images do not block the window load event expected true got false
FAIL Deferred images with loading='lazy' use the original base URL specified at the parse time assert_unreached: The image request should not load relative to the current (incorrect) base URL. Reached unreachable code

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
<head>
<title>Deferred images with loading='lazy' use the original
base URL specified at the parse time</title>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@


PASS Test that when deferred iframe is loaded, it uses the base URL computed at parse time.
PASS Test that when deferred img is loaded, it uses the base URL computed at parse time.
FAIL Test that when deferred img is loaded, it uses the base URL computed at parse time. assert_unreached: The image load should not fail, trying to load with invalid base URL. Reached unreachable code

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
<head>
<title>Deferred iframes with loading='lazy' use the original
base URL specified at the parse time</title>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
<head>
<title>Deferred iframes and images with loading='lazy' use the original base URL specified at the parse time</title>
<link rel="author" title="Raj T" href="mailto:[email protected]">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Blocked access to external URL http://www.127.0.0.1:8800/html/semantics/embedded-content/the-img-element/resources/image.png
Blocked access to external URL http://www.127.0.0.1:8800/html/semantics/embedded-content/the-img-element/resources/image.png


FAIL Test that when deferred image is loaded, it uses the crossorigin attribute specified at parse time. assert_unreached: The image load should not fail, trying to load with CORS headers set. Reached unreachable code
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
<head>
<title>Deferred images with loading='lazy' use the original crossorigin attribute specified at the parse time</title>
<link rel="author" title="Raj T" href="mailto:[email protected]">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@


PASS Test that when deferred iframe is loaded, it uses the referrer-policy specified at parse time.
PASS Test that when deferred img is loaded, it uses the referrer-policy specified at parse time.
FAIL Test that when deferred img is loaded, it uses the referrer-policy specified at parse time. assert_unreached: The image load should not fail, by sending the wrong referer header. Reached unreachable code

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!DOCTYPE html><!-- webkit-test-runner [ experimental:enableLazyImageLoading=true ] -->
<head>
<title>Deferred iframes and images with loading='lazy' use the original referrer-policy specified at the parse time</title>
<link rel="author" title="Raj T" href="mailto:[email protected]">
Expand Down
2 changes: 2 additions & 0 deletions LayoutTests/platform/mac-wk1/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ http/tests/lazyload [ Skip ]
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/below-viewport-image-loading-lazy-load-event.html [ Skip ]
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/disconnected-image-loading-lazy.html [ Skip ]
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-below-viewport-dynamic.html [ Skip ]
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-cross-origin-ifame-001.sub.html [ Skip ]
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-cross-origin-ifame-002.sub.html [ Skip ]
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-viewport-dynamic.html [ Skip ]
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-load-event.html [ Skip ]
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-move-document.html [ Skip ]
Expand Down
2 changes: 2 additions & 0 deletions LayoutTests/platform/win/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -4540,6 +4540,8 @@ webkit.org/b/207499 webanimations/transform-accelerated-animation-finishes-befor
http/tests/lazyload [ Skip ]
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/below-viewport-image-loading-lazy-load-event.html [ Skip ]
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-below-viewport-dynamic.html [ Skip ]
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-cross-origin-ifame-001.sub.html [ Skip ]
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-cross-origin-ifame-002.sub.html [ Skip ]
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-in-viewport-dynamic.html [ Skip ]
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-load-event.html [ Skip ]
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-move-document.html [ Skip ]
Expand Down

0 comments on commit 0dc8011

Please sign in to comment.