Commit d13faa6c authored by Chris Harrelson's avatar Chris Harrelson Committed by Commit Bot

Re-land: Remove workaround [1] to add a placeholder for lazyload images.

This is a re-land of [2]. It was reverted due to a flakiness introduce
in [3]. The reason for the flakiness appears to have a couple of sources:
(a) sometimes the image for one of the ref/non-ref will load a bit faster
(b) scrollbars present in the ref case, because the image is not clipped
by overflow:hidden
(c) 8px margin

(a) is fixed by using reftest-wait. (b) is fixed by adding overflow:hidden
to the HTML element; (c) is fixed with margin:0.

[1] https://chromium-review.googlesource.com/c/chromium/src/+/1773869
[2] https://chromium-review.googlesource.com/c/chromium/src/+/2103708
[3] external/wpt/html/semantics/embedded-content/the-img-element/image-loading-subpixel-clip.html

Bug: 992765, 999019, 995119, 999209, 1045745

Change-Id: I6ad8c5564f65d131da9b04180499a4bd98a4c8d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2111906Reviewed-by: default avatarStefan Zager <szager@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#752209}
parent f353b151
......@@ -569,18 +569,7 @@ void ImageLoader::DoUpdateFromElement(
}
}
if (lazy_image_load_state_ == LazyImageLoadState::kDeferred &&
was_fully_deferred_ && !ShouldLoadImmediately(url)) {
// TODO(rajendrant): Remove this temporary workaround of creating a 1x1
// placeholder to fix an intersection observer issue not firing with
// certain styles (https://crbug.com/992765). Instead
// NoImageResourceToLoad() should be skipped when the image is deferred.
// https://crbug.com/999209
new_image_content = ImageResourceContent::CreateLazyImagePlaceholder();
} else {
new_image_content =
ImageResourceContent::Fetch(params, document.Fetcher());
}
new_image_content = ImageResourceContent::Fetch(params, document.Fetcher());
// If this load is starting while navigating away, treat it as an auditing
// keepalive request, and don't report its results back to the element.
......
......@@ -5961,8 +5961,6 @@ crbug.com/995669 [ Win ] virtual/audio-service/http/tests/media/video-throttled-
crbug.com/997669 [ Win ] http/tests/devtools/search/sources-search-scope-in-files.js [ Pass Crash ]
crbug.com/626703 external/wpt/css/css-paint-api/custom-property-animation-on-main-thread.https.html [ Pass Failure ]
crbug.com/999209 virtual/lazyload-image/http/tests/lazyload/style-dimension.html [ Timeout ]
crbug.com/1015130 external/wpt/largest-contentful-paint/first-paint-equals-lcp-text.html [ Failure Pass ]
crbug.com/1015130 virtual/scalefactor200/external/wpt/largest-contentful-paint/first-paint-equals-lcp-text.html [ Failure Pass ]
crbug.com/1015130 virtual/scalefactor200withoutzoom/external/wpt/largest-contentful-paint/first-paint-equals-lcp-text.html [ Failure Pass ]
......
<!DOCTYPE html>
<style>
* {
margin: 0;
}
</style>
<html class="reftest-wait" style="overflow: hidden">
<head>
<title>Images with loading='lazy' load under subpixel-offset clips</title>
<link rel="author" title="Chris Harrelson" href="mailto:chrishtr@chromium.org">
<link rel="help" href="https://html.spec.whatwg.org/#lazy-loading-attributes">
</head>
<div style="height: 3.7499995rem; "></div>
<div style="position: relative; font-size: 0; background: lightblue">
<img id=target loading="lazy" data-sizes="auto" src="resources/image.png"
title="" width="1600">
</div>
</html>
<script src="/common/reftest-wait.js"></script>
<script>
target.onload = takeScreenshot;
</script>
<!DOCTYPE html>
<style>
* {
margin: 0;
}
</style>
<html class="reftest-wait" style="overflow: hidden">
<head>
<title>Images with loading='lazy' load under subpixel-offset clips</title>
<link rel="author" title="Chris Harrelson" href="mailto:chrishtr@chromium.org">
<link rel="help" href="https://html.spec.whatwg.org/#lazy-loading-attributes">
<link rel="match" href="image-loading-subpixel-clip-ref.html">
</head>
<div style="height: 3.7499995rem"></div>
<div style="overflow: hidden">
<div style="position: relative; font-size: 0; background: lightblue">
<img id=target loading="lazy" data-sizes="auto" src="resources/image.png"
title="" width="1600">
</div>
</div>
</html>
<script src="/common/reftest-wait.js"></script>
<script>
target.onload = takeScreenshot;
</script>
This is a testharness.js-based test.
PASS Test that when deferred iframe 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
Harness: the test ran to completion.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment