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:
> https://github.com/WICG/largest-contentful-paint/issues/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}
diff --git a/images/anim-tao.png b/images/anim-tao.png
deleted file mode 100644
index 925e2ef..0000000
--- a/images/anim-tao.png
+++ /dev/null
Binary files differ
diff --git a/images/anim-tao.png.headers b/images/anim-tao.png.headers
deleted file mode 100644
index 0230e17..0000000
--- a/images/anim-tao.png.headers
+++ /dev/null
@@ -1,2 +0,0 @@
-Timing-Allow-Origin: *
-
diff --git a/images/webp-animated.webp b/images/webp-animated.webp
deleted file mode 100644
index 35a8dfc..0000000
--- a/images/webp-animated.webp
+++ /dev/null
Binary files differ
diff --git a/largest-contentful-paint/animated/observe-animated-image-gif.tentative.html b/largest-contentful-paint/animated/observe-animated-image-gif.tentative.html
deleted file mode 100644
index a2c0d79..0000000
--- a/largest-contentful-paint/animated/observe-animated-image-gif.tentative.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <meta charset=utf-8>
-  <title>Largest Contentful Paint: observe image.</title>
-  <script src="/resources/testharness.js"></script>
-  <script src="/resources/testharnessreport.js"></script>
-  <script src="../resources/largest-contentful-paint-helpers.js"></script>
-</head>
-<body>
-  <script>
-    promise_test(async () => {
-      assert_implements(window.LargestContentfulPaint,
-                        "LargestContentfulPaint is not implemented");
-      const beforeLoad = performance.now();
-      // 136 is the size of the animated GIF up until the first frame.
-      // The trickle pipe delays the response after the first frame by 1 second.
-      const url = window.location.origin +
-                  `/images/anim-gr.gif?pipe=trickle(136:d${delay_pipe_value})`;
-      const entry = await load_and_observe(url);
-      // anim-gr.gif is 100 by 50.
-      const size = 100 * 50;
-      checkImage(entry, url, 'image_id', size, beforeLoad, ["animated"]);
-    }, "Same origin animated image is observable and has a first frame.");
-  </script>
-</body>
-</html>
diff --git a/largest-contentful-paint/animated/observe-animated-image-webp.tentative.html b/largest-contentful-paint/animated/observe-animated-image-webp.tentative.html
deleted file mode 100644
index de59d5c..0000000
--- a/largest-contentful-paint/animated/observe-animated-image-webp.tentative.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <meta charset=utf-8>
-  <title>Largest Contentful Paint: observe image.</title>
-  <script src="/resources/testharness.js"></script>
-  <script src="/resources/testharnessreport.js"></script>
-  <script src="../resources/largest-contentful-paint-helpers.js"></script>
-</head>
-<body>
-  <script>
-    promise_test(async () => {
-      assert_implements(window.LargestContentfulPaint,
-                        "LargestContentfulPaint is not implemented");
-      const beforeLoad = performance.now();
-      // 142 is the size of the animated WebP up until the first frame.
-      // The trickle pipe delays the response after the first frame by 1 second.
-      const url = window.location.origin +
-        `/images/webp-animated.webp?pipe=trickle(142:d${delay_pipe_value})`;
-      const entry = await load_and_observe(url);
-      // webp-animated.webp is 11 by 29.
-      const size = 11 * 29;
-      checkImage(entry, url, 'image_id', size, beforeLoad, ["animated"]);
-    }, "Same origin animated image is observable and has a first frame.");
-  </script>
-</body>
-</html>
diff --git a/largest-contentful-paint/animated/observe-animated-image.tentative.html b/largest-contentful-paint/animated/observe-animated-image.tentative.html
deleted file mode 100644
index cf7d262..0000000
--- a/largest-contentful-paint/animated/observe-animated-image.tentative.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <meta charset=utf-8>
-  <title>Largest Contentful Paint: observe image.</title>
-  <script src="/resources/testharness.js"></script>
-  <script src="/resources/testharnessreport.js"></script>
-  <script src="../resources/largest-contentful-paint-helpers.js"></script>
-</head>
-<body>
-  <script>
-    promise_test(async () => {
-      assert_implements(window.LargestContentfulPaint,
-                        "LargestContentfulPaint is not implemented");
-      const beforeLoad = performance.now();
-      // 262 is the size of the animated PNG up until the first frame,
-      // including the chunk that starts the second frame (indicating that
-      // the first frame data is done).
-      // The trickle pipe delays the response after the first frame by 1 second.
-      const url = window.location.origin +
-                  `/images/anim-gr.png?pipe=trickle(262:d${delay_pipe_value})`;
-      const entry = await load_and_observe(url);
-      // anim-gr.png is 100 by 50.
-      const size = 100 * 50;
-      checkImage(entry, url, 'image_id', size, beforeLoad, ["animated"]);
-    }, "Same origin animated image is observable and has a first frame.");
-  </script>
-</body>
-</html>
diff --git a/largest-contentful-paint/animated/observe-cross-origin-animated-image.tentative.html b/largest-contentful-paint/animated/observe-cross-origin-animated-image.tentative.html
deleted file mode 100644
index 993883c..0000000
--- a/largest-contentful-paint/animated/observe-cross-origin-animated-image.tentative.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <meta charset=utf-8>
-  <title>Largest Contentful Paint: observe image.</title>
-  <script src="/resources/testharness.js"></script>
-  <script src="/resources/testharnessreport.js"></script>
-  <script src="../resources/largest-contentful-paint-helpers.js"></script>
-  <script src="/common/get-host-info.sub.js"></script>
-</head>
-<body>
-  <script>
-    promise_test(async () => {
-      assert_implements(window.LargestContentfulPaint,
-                        "LargestContentfulPaint is not implemented");
-      const beforeLoad = performance.now();
-      // 262 is the size of the animated PNG up until the first frame,
-      // including the chunk that starts the second frame (indicating that
-      //the first frame data is done).
-      const {REMOTE_ORIGIN} = get_host_info();
-      const url = REMOTE_ORIGIN +
-                  '/images/anim-gr.png?pipe=trickle(262:d1)';
-      const entry = await load_and_observe(url);
-      // anim-gr.png is 100 by 50.
-      const size = 100 * 50;
-      checkImage(entry, url, 'image_id', size, beforeLoad, ["renderTimeIs0", "animated-zero"]);
-    }, "Same origin animated image is observable and has a first frame.");
-  </script>
-</body>
-</html>
diff --git a/largest-contentful-paint/animated/observe-cross-origin-tao-animated-image.tentative.html b/largest-contentful-paint/animated/observe-cross-origin-tao-animated-image.tentative.html
deleted file mode 100644
index 137dde6..0000000
--- a/largest-contentful-paint/animated/observe-cross-origin-tao-animated-image.tentative.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <meta charset=utf-8>
-  <title>Largest Contentful Paint: observe image.</title>
-  <script src="/resources/testharness.js"></script>
-  <script src="/resources/testharnessreport.js"></script>
-  <script src="../resources/largest-contentful-paint-helpers.js"></script>
-  <script src="/common/get-host-info.sub.js"></script>
-</head>
-<body>
-  <script>
-    promise_test(async () => {
-      assert_implements(window.LargestContentfulPaint,
-                        "LargestContentfulPaint is not implemented");
-      const beforeLoad = performance.now();
-      // 262 is the size of the animated PNG up until the first frame,
-      // including the chunk that starts the second frame (indicating that
-      //the first frame data is done).
-      const {REMOTE_ORIGIN} = get_host_info();
-      const url = REMOTE_ORIGIN +
-                  '/images/anim-tao.png?pipe=trickle(262:d1)';
-      const entry = await load_and_observe(url);
-      // anim-gr.png is 100 by 50.
-      const size = 100 * 50;
-      checkImage(entry, url, 'image_id', size, beforeLoad, ["animated"]);
-    }, "Same origin animated image is observable and has a first frame.");
-  </script>
-</body>
-</html>
diff --git a/largest-contentful-paint/animated/observe-non-animated-image.tentative.html b/largest-contentful-paint/animated/observe-non-animated-image.tentative.html
deleted file mode 100644
index 6bbc095..0000000
--- a/largest-contentful-paint/animated/observe-non-animated-image.tentative.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <meta charset=utf-8>
-  <title>Largest Contentful Paint: observe image.</title>
-  <script src="/resources/testharness.js"></script>
-  <script src="/resources/testharnessreport.js"></script>
-  <script src="../resources/largest-contentful-paint-helpers.js"></script>
-</head>
-<body>
-  <script>
-    promise_test(async () => {
-      assert_implements(window.LargestContentfulPaint,
-                        "LargestContentfulPaint is not implemented");
-      const beforeLoad = performance.now();
-      // 262 is the size of the animated PNG up until the first frame,
-      // including the chunk that starts the second frame (indicating that
-      //the first frame data is done).
-      const url = window.location.origin + '/images/blue.png';
-      const entry = await load_and_observe(url);
-      // blue.png is 133 by 106.
-      const size = 133 * 106;
-      checkImage(entry, url, 'image_id', size, beforeLoad, ["animated-zero"]);
-    }, "Same origin animated image is observable and has a first frame.");
-  </script>
-</body>
-</html>
diff --git a/largest-contentful-paint/resources/largest-contentful-paint-helpers.js b/largest-contentful-paint/resources/largest-contentful-paint-helpers.js
index 5012faf..e12ece0 100644
--- a/largest-contentful-paint/resources/largest-contentful-paint-helpers.js
+++ b/largest-contentful-paint/resources/largest-contentful-paint-helpers.js
@@ -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:
@@ -36,33 +33,4 @@
   } 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);
-  });
-};