Skip to content

Commit 8e24799

Browse files
Mikel Astizchromium-wpt-export-bot
Mikel Astiz
authored andcommitted
Revert "[LCP] Add animated image support"
This reverts commit b7d510c06e0436cfb4bd7260175cd460b949225c. Reason for revert: speculative revert for new flakiness in PageLoadMetricsBrowserTestWithAnimatedLCPFlag, see first failing build https://ci.chromium.org/p/chromium/builders/ci/Linux%20Tests%20%28dbg%29%281%29/99853 Original change's description: > [LCP] Add animated image support > > This CL adds support for better handling of animated images in LCP: > * A new attribute is exposing the first animated frame's paint time > (behind a flag). > * `startTime` is not changed. > * The PageLoadMetrics reported for LCP are set to that first frame paint > time for animated images (behind another flag). > * Entries are not emitted until the image is loaded. > > Relevant spec issue: > w3c/largest-contentful-paint#83 > > Change-Id: I6bb01eacb4f200f9c032ffcfcd9a1a41126a7773 > Bug: 1260953 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3226157 > Commit-Queue: Yoav Weiss <yoavweiss@chromium.org> > Reviewed-by: Nicolás Peña Moreno <npm@chromium.org> > Cr-Commit-Position: refs/heads/main@{#935133} Bug: 1260953 Change-Id: I00878689de95de38645195da81c6baf577d868a6 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3247071 Auto-Submit: Mikel Astiz <mastiz@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Mikel Astiz <mastiz@chromium.org> Owners-Override: Mikel Astiz <mastiz@google.com> Cr-Commit-Position: refs/heads/main@{#935350}
1 parent 18bfd1b commit 8e24799

10 files changed

+0
-204
lines changed

images/anim-tao.png

-460 Bytes
Binary file not shown.

images/anim-tao.png.headers

-2
This file was deleted.

images/webp-animated.webp

-340 Bytes
Binary file not shown.

largest-contentful-paint/animated/observe-animated-image-gif.tentative.html

-27
This file was deleted.

largest-contentful-paint/animated/observe-animated-image-webp.tentative.html

-27
This file was deleted.

largest-contentful-paint/animated/observe-animated-image.tentative.html

-29
This file was deleted.

largest-contentful-paint/animated/observe-cross-origin-animated-image.tentative.html

-30
This file was deleted.

largest-contentful-paint/animated/observe-cross-origin-tao-animated-image.tentative.html

-30
This file was deleted.

largest-contentful-paint/animated/observe-non-animated-image.tentative.html

-27
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
const image_delay = 1000;
2-
const delay_pipe_value = image_delay / 1000;
3-
41
// Receives an image LargestContentfulPaint |entry| and checks |entry|'s attribute values.
52
// The |timeLowerBound| parameter is a lower bound on the loadTime value of the entry.
63
// The |options| parameter may contain some string values specifying the following:
@@ -36,33 +33,4 @@ function checkImage(entry, expectedUrl, expectedID, expectedSize, timeLowerBound
3633
} else {
3734
assert_equals(entry.size, expectedSize);
3835
}
39-
if (options.includes('animated')) {
40-
assert_greater_than(entry.loadTime, entry.firstAnimatedFrameTime,
41-
'firstAnimatedFrameTime should be smaller than loadTime');
42-
assert_greater_than(entry.renderTime, entry.firstAnimatedFrameTime,
43-
'firstAnimatedFrameTime should be smaller than renderTime');
44-
assert_less_than(entry.firstAnimatedFrameTime, image_delay,
45-
'firstAnimatedFrameTime should be smaller than the delay applied to the second frame');
46-
assert_greater_than(entry.firstAnimatedFrameTime, 0,
47-
'firstAnimatedFrameTime should be larger than 0');
48-
}
49-
if (options.includes('animated-zero')) {
50-
assert_equals(entry.firstAnimatedFrameTime, 0, 'firstAnimatedFrameTime should be 0');
51-
}
5236
}
53-
54-
const load_and_observe = url => {
55-
return new Promise(resolve => {
56-
(new PerformanceObserver(entryList => {
57-
for (let entry of entryList.getEntries()) {
58-
if (entry.url == url) {
59-
resolve(entryList.getEntries()[0]);
60-
}
61-
}
62-
})).observe({type: 'largest-contentful-paint', buffered: true});
63-
const img = new Image();
64-
img.id = 'image_id';
65-
img.src = url;
66-
document.body.appendChild(img);
67-
});
68-
};

0 commit comments

Comments
 (0)