Skip to content

Commit

Permalink
Revert "[LCP] Add animated image support"
Browse files Browse the repository at this point in the history
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 <[email protected]>
> Reviewed-by: Nicolás Peña Moreno <[email protected]>
> 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 <[email protected]>
Bot-Commit: Rubber Stamper <[email protected]>
Commit-Queue: Mikel Astiz <[email protected]>
Owners-Override: Mikel Astiz <[email protected]>
Cr-Commit-Position: refs/heads/main@{#935350}
  • Loading branch information
Mikel Astiz authored and chromium-wpt-export-bot committed Oct 27, 2021
1 parent 6bbec86 commit 1ed6a86
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 204 deletions.
Binary file removed images/anim-tao.png
Binary file not shown.
2 changes: 0 additions & 2 deletions images/anim-tao.png.headers

This file was deleted.

Binary file removed images/webp-animated.webp
Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
const image_delay = 1000;
const delay_pipe_value = image_delay / 1000;

// Receives an image LargestContentfulPaint |entry| and checks |entry|'s attribute values.
// The |timeLowerBound| parameter is a lower bound on the loadTime value of the entry.
// The |options| parameter may contain some string values specifying the following:
Expand Down Expand Up @@ -36,33 +33,4 @@ function checkImage(entry, expectedUrl, expectedID, expectedSize, timeLowerBound
} else {
assert_equals(entry.size, expectedSize);
}
if (options.includes('animated')) {
assert_greater_than(entry.loadTime, entry.firstAnimatedFrameTime,
'firstAnimatedFrameTime should be smaller than loadTime');
assert_greater_than(entry.renderTime, entry.firstAnimatedFrameTime,
'firstAnimatedFrameTime should be smaller than renderTime');
assert_less_than(entry.firstAnimatedFrameTime, image_delay,
'firstAnimatedFrameTime should be smaller than the delay applied to the second frame');
assert_greater_than(entry.firstAnimatedFrameTime, 0,
'firstAnimatedFrameTime should be larger than 0');
}
if (options.includes('animated-zero')) {
assert_equals(entry.firstAnimatedFrameTime, 0, 'firstAnimatedFrameTime should be 0');
}
}

const load_and_observe = url => {
return new Promise(resolve => {
(new PerformanceObserver(entryList => {
for (let entry of entryList.getEntries()) {
if (entry.url == url) {
resolve(entryList.getEntries()[0]);
}
}
})).observe({type: 'largest-contentful-paint', buffered: true});
const img = new Image();
img.id = 'image_id';
img.src = url;
document.body.appendChild(img);
});
};

0 comments on commit 1ed6a86

Please sign in to comment.