Title: [290080] trunk/LayoutTests/imported/w3c
Revision
290080
Author
n...@webkit.org
Date
2022-02-17 15:13:23 -0800 (Thu, 17 Feb 2022)

Log Message

Resync web-platform-tests/paint-timing from upstream
https://bugs.webkit.org/show_bug.cgi?id=236717

Reviewed by Simon Fraser.

Resync to af3b9946eb6f0955360282176848af4be7e58304

* web-platform-tests/paint-timing/fcp-only/buffered-flag.window.html: Added.
* web-platform-tests/paint-timing/fcp-only/buffered-flag.window.js: Added.
* web-platform-tests/paint-timing/fcp-only/fcp-background-size.html:
* web-platform-tests/paint-timing/fcp-only/fcp-bg-image-set.html:
* web-platform-tests/paint-timing/fcp-only/fcp-bg-image-two-steps-expected.txt:
* web-platform-tests/paint-timing/fcp-only/fcp-bg-image-two-steps.html:
* web-platform-tests/paint-timing/fcp-only/fcp-canvas-context-expected.txt:
* web-platform-tests/paint-timing/fcp-only/fcp-canvas-context.html:
* web-platform-tests/paint-timing/fcp-only/fcp-gradient-expected.txt:
* web-platform-tests/paint-timing/fcp-only/fcp-gradient.html:
* web-platform-tests/paint-timing/fcp-only/fcp-iframe-expected.txt: Added.
* web-platform-tests/paint-timing/fcp-only/fcp-iframe.html: Copied from LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-ignore-from-subframe.html.
* web-platform-tests/paint-timing/fcp-only/fcp-ignore-from-subframe.html:
* web-platform-tests/paint-timing/fcp-only/fcp-invisible-3d-rotate-expected.txt:
* web-platform-tests/paint-timing/fcp-only/fcp-invisible-scale-expected.txt:
* web-platform-tests/paint-timing/fcp-only/fcp-invisible-scale-transition-expected.txt:
* web-platform-tests/paint-timing/fcp-only/fcp-invisible-scale.html:
* web-platform-tests/paint-timing/fcp-only/fcp-invisible-text-expected.txt:
* web-platform-tests/paint-timing/fcp-only/fcp-opacity-descendant-expected.txt:
* web-platform-tests/paint-timing/fcp-only/fcp-opacity-expected.txt:
* web-platform-tests/paint-timing/fcp-only/fcp-opacity.html:
* web-platform-tests/paint-timing/fcp-only/fcp-out-of-bounds-expected.txt:
* web-platform-tests/paint-timing/fcp-only/fcp-out-of-bounds-translate-expected.txt:
* web-platform-tests/paint-timing/fcp-only/fcp-out-of-bounds.html:
* web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-display-expected.txt:
* web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-image-expected.txt:
* web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-image.html:
* web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-opacity-expected.txt:
* web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-text-expected.txt:
* web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-visibility-expected.txt:
* web-platform-tests/paint-timing/fcp-only/fcp-svg-expected.txt:
* web-platform-tests/paint-timing/fcp-only/fcp-text-input-expected.txt:
* web-platform-tests/paint-timing/fcp-only/fcp-text-input.html:
* web-platform-tests/paint-timing/fcp-only/fcp-typographic-pseudo-expected.txt:
* web-platform-tests/paint-timing/fcp-only/fcp-video-frame-expected.txt:
* web-platform-tests/paint-timing/fcp-only/fcp-video-frame.html:
* web-platform-tests/paint-timing/fcp-only/fcp-video-poster-expected.txt:
* web-platform-tests/paint-timing/fcp-only/fcp-video-poster.html:
* web-platform-tests/paint-timing/fcp-only/fcp-whitespace-expected.txt:
* web-platform-tests/paint-timing/fcp-only/fcp-whitespace.html:
* web-platform-tests/paint-timing/fcp-only/fcp-with-rtl-expected.txt:
* web-platform-tests/paint-timing/fcp-only/fcp-with-rtl.html:
* web-platform-tests/paint-timing/fcp-only/svg-in-iframe-expected.txt: Added.
* web-platform-tests/paint-timing/fcp-only/svg-in-iframe.html: Added.
* web-platform-tests/paint-timing/resources/svg.html: Added.
* web-platform-tests/paint-timing/resources/utils.js:
(async assertFirstContentfulPaint.return.new.Promise):
(async assertFirstContentfulPaint):
(async test_fcp):

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-02-17 23:13:23 UTC (rev 290080)
@@ -1,3 +1,62 @@
+2022-02-17  Noam Rosenthal  <n...@webkit.org>
+
+        Resync web-platform-tests/paint-timing from upstream
+        https://bugs.webkit.org/show_bug.cgi?id=236717
+
+        Reviewed by Simon Fraser.
+
+        Resync to af3b9946eb6f0955360282176848af4be7e58304
+
+        * web-platform-tests/paint-timing/fcp-only/buffered-flag.window.html: Added.
+        * web-platform-tests/paint-timing/fcp-only/buffered-flag.window.js: Added.
+        * web-platform-tests/paint-timing/fcp-only/fcp-background-size.html:
+        * web-platform-tests/paint-timing/fcp-only/fcp-bg-image-set.html:
+        * web-platform-tests/paint-timing/fcp-only/fcp-bg-image-two-steps-expected.txt:
+        * web-platform-tests/paint-timing/fcp-only/fcp-bg-image-two-steps.html:
+        * web-platform-tests/paint-timing/fcp-only/fcp-canvas-context-expected.txt:
+        * web-platform-tests/paint-timing/fcp-only/fcp-canvas-context.html:
+        * web-platform-tests/paint-timing/fcp-only/fcp-gradient-expected.txt:
+        * web-platform-tests/paint-timing/fcp-only/fcp-gradient.html:
+        * web-platform-tests/paint-timing/fcp-only/fcp-iframe-expected.txt: Added.
+        * web-platform-tests/paint-timing/fcp-only/fcp-iframe.html: Copied from LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-ignore-from-subframe.html.
+        * web-platform-tests/paint-timing/fcp-only/fcp-ignore-from-subframe.html:
+        * web-platform-tests/paint-timing/fcp-only/fcp-invisible-3d-rotate-expected.txt:
+        * web-platform-tests/paint-timing/fcp-only/fcp-invisible-scale-expected.txt:
+        * web-platform-tests/paint-timing/fcp-only/fcp-invisible-scale-transition-expected.txt:
+        * web-platform-tests/paint-timing/fcp-only/fcp-invisible-scale.html:
+        * web-platform-tests/paint-timing/fcp-only/fcp-invisible-text-expected.txt:
+        * web-platform-tests/paint-timing/fcp-only/fcp-opacity-descendant-expected.txt:
+        * web-platform-tests/paint-timing/fcp-only/fcp-opacity-expected.txt:
+        * web-platform-tests/paint-timing/fcp-only/fcp-opacity.html:
+        * web-platform-tests/paint-timing/fcp-only/fcp-out-of-bounds-expected.txt:
+        * web-platform-tests/paint-timing/fcp-only/fcp-out-of-bounds-translate-expected.txt:
+        * web-platform-tests/paint-timing/fcp-only/fcp-out-of-bounds.html:
+        * web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-display-expected.txt:
+        * web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-image-expected.txt:
+        * web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-image.html:
+        * web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-opacity-expected.txt:
+        * web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-text-expected.txt:
+        * web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-visibility-expected.txt:
+        * web-platform-tests/paint-timing/fcp-only/fcp-svg-expected.txt:
+        * web-platform-tests/paint-timing/fcp-only/fcp-text-input-expected.txt:
+        * web-platform-tests/paint-timing/fcp-only/fcp-text-input.html:
+        * web-platform-tests/paint-timing/fcp-only/fcp-typographic-pseudo-expected.txt:
+        * web-platform-tests/paint-timing/fcp-only/fcp-video-frame-expected.txt:
+        * web-platform-tests/paint-timing/fcp-only/fcp-video-frame.html:
+        * web-platform-tests/paint-timing/fcp-only/fcp-video-poster-expected.txt:
+        * web-platform-tests/paint-timing/fcp-only/fcp-video-poster.html:
+        * web-platform-tests/paint-timing/fcp-only/fcp-whitespace-expected.txt:
+        * web-platform-tests/paint-timing/fcp-only/fcp-whitespace.html:
+        * web-platform-tests/paint-timing/fcp-only/fcp-with-rtl-expected.txt:
+        * web-platform-tests/paint-timing/fcp-only/fcp-with-rtl.html:
+        * web-platform-tests/paint-timing/fcp-only/svg-in-iframe-expected.txt: Added.
+        * web-platform-tests/paint-timing/fcp-only/svg-in-iframe.html: Added.
+        * web-platform-tests/paint-timing/resources/svg.html: Added.
+        * web-platform-tests/paint-timing/resources/utils.js:
+        (async assertFirstContentfulPaint.return.new.Promise):
+        (async assertFirstContentfulPaint):
+        (async test_fcp):
+
 2022-02-17  Jon Lee  <jon...@apple.com>
 
         Unreviewed gardening. Add fuzzy data.

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/buffered-flag.window-expected.txt (0 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/buffered-flag.window-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/buffered-flag.window-expected.txt	2022-02-17 23:13:23 UTC (rev 290080)
@@ -0,0 +1,5 @@
+
+Harness Error (TIMEOUT), message = null
+
+TIMEOUT PerformanceObserver with buffered flag sees previous FCP entry. Test timed out
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/buffered-flag.window.html (0 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/buffered-flag.window.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/buffered-flag.window.html	2022-02-17 23:13:23 UTC (rev 290080)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/buffered-flag.window.js (0 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/buffered-flag.window.js	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/buffered-flag.window.js	2022-02-17 23:13:23 UTC (rev 290080)
@@ -0,0 +1,24 @@
+setup({"hide_test_state": true});
+async_test(t => {
+  assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
+  // First observer creates a second one in the callback to ensure the entry has been dispatched
+  // by the time the second observer begins observing.
+  new PerformanceObserver(entries => {
+    const entry_seen = entries.getEntriesByName('first-contentful-paint').length > 0;
+    // Abort if we have not yet received the entry.
+    if (!entry_seen)
+      return;
+
+    // Second observer requires 'buffered: true' to see the entry.
+    new PerformanceObserver(t.step_func_done(list => {
+        const fcp = list.getEntriesByName('first-contentful-paint');
+        assert_equals(fcp.length, 1, 'Should have an fcp entry');
+        const entry = fcp[0];
+        assert_equals(entry.entryType, 'paint');
+      })).observe({'type': 'paint', buffered: true});
+  }).observe({'entryTypes': ['paint']});
+  // Trigger the first contentful paint entry.
+  const img = document.createElement("img");
+  img.src = ""
+  document.body.appendChild(img);
+}, "PerformanceObserver with buffered flag sees previous FCP entry.");

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-background-size-expected.txt (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-background-size-expected.txt	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-background-size-expected.txt	2022-02-17 23:13:23 UTC (rev 290080)
@@ -1,3 +1,5 @@
 
-FAIL First contentful paint fires due to background size. promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: assert_precondition"
+Harness Error (TIMEOUT), message = null
 
+TIMEOUT First contentful paint fires due to background size. Test timed out
+

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-background-size.html (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-background-size.html	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-background-size.html	2022-02-17 23:13:23 UTC (rev 290080)
@@ -22,7 +22,17 @@
 <script src=""
 <div id="main"></div>
 <script>
-    test_fcp("First contentful paint fires due to background size.");
+    // Load the image into memory first to make sure it's decoded.
+    function load_image() {
+      const img = document.createElement("img");
+      img.src = ""
+
+      return new Promise(resolve => {
+        img._onload_ = async () => resolve();
+      });
+    }
+
+    test_fcp("First contentful paint fires due to background size.", load_image);
 </script>
 </body>
 </html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-bg-image-set-expected.txt (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-bg-image-set-expected.txt	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-bg-image-set-expected.txt	2022-02-17 23:13:23 UTC (rev 290080)
@@ -1,3 +1,5 @@
 
-FAIL First contentful paint fires due to background image in image-set. promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: assert_precondition"
+Harness Error (TIMEOUT), message = null
 
+TIMEOUT First contentful paint fires due to background image in image-set. Test timed out
+

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-bg-image-set.html (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-bg-image-set.html	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-bg-image-set.html	2022-02-17 23:13:23 UTC (rev 290080)
@@ -20,7 +20,17 @@
 <script src=""
 <div id="main"></div>
 <script>
-    test_fcp("First contentful paint fires due to background image in image-set.");
+    // Load the image into memory first to make sure it's decoded.
+    function load_image() {
+      const img = document.createElement("img");
+      img.src = ""
+
+      return new Promise(resolve => {
+        img._onload_ = async () => resolve();
+      });
+    }
+
+    test_fcp("First contentful paint fires due to background image in image-set.", load_image);
 </script>
 </body>
 </html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-bg-image-two-steps-expected.txt (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-bg-image-two-steps-expected.txt	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-bg-image-two-steps-expected.txt	2022-02-17 23:13:23 UTC (rev 290080)
@@ -1,3 +1,5 @@
 
-FAIL First contentful paint fires for background image only when visible. promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: assert_precondition"
+Harness Error (TIMEOUT), message = null
 
+TIMEOUT First contentful paint fires for background image only when visible. Test timed out
+

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-bg-image-two-steps.html (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-bg-image-two-steps.html	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-bg-image-two-steps.html	2022-02-17 23:13:23 UTC (rev 290080)
@@ -27,7 +27,17 @@
 <script src=""
 <div id="main"></div>
 <script>
-    test_fcp("First contentful paint fires for background image only when visible.");
+    // Load the image into memory first to make sure it's decoded.
+    function load_image() {
+      const img = document.createElement("img");
+      img.src = ""
+
+      return new Promise(resolve => {
+        img._onload_ = async () => resolve();
+      });
+    }
+
+    test_fcp("First contentful paint fires for background image only when visible.", load_image);
 </script>
 </body>
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-canvas-context-expected.txt (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-canvas-context-expected.txt	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-canvas-context-expected.txt	2022-02-17 23:13:23 UTC (rev 290080)
@@ -1,3 +1,3 @@
 
-FAIL Canvas should count as contentful when context is created promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: assert_precondition"
+PASS Canvas should count as contentful when context is created
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-canvas-context.html (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-canvas-context.html	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-canvas-context.html	2022-02-17 23:13:23 UTC (rev 290080)
@@ -8,8 +8,9 @@
 <script src=""
 <canvas id="canvas" width="50" height="50"></canvas>
 <script>
+  setup({"hide_test_state": true});
   promise_test(async t => {
-    assert_precondition(window.PerformancePaintTiming, "Paint Timing isn't supported.");
+    assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
     await new Promise(r => window.addEventListener('load', r));
     await assertNoFirstContentfulPaint(t);
     const canvas = document.getElementById('canvas');

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-gradient-expected.txt (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-gradient-expected.txt	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-gradient-expected.txt	2022-02-17 23:13:23 UTC (rev 290080)
@@ -1,3 +1,3 @@
 
-FAIL Gradients should not count as contentful promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: assert_precondition"
+PASS Gradients should not count as contentful
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-gradient.html (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-gradient.html	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-gradient.html	2022-02-17 23:13:23 UTC (rev 290080)
@@ -15,8 +15,9 @@
 <script src=""
 <div id="main"></div>
 <script>
+  setup({"hide_test_state": true});
   promise_test(async t => {
-      assert_precondition(window.PerformancePaintTiming, "Paint Timing isn't supported.");
+      assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
       await new Promise(r => window.addEventListener('load', r));
       await assertNoFirstContentfulPaint(t);
   },  'Gradients should not count as contentful');

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-iframe-expected.txt (0 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-iframe-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-iframe-expected.txt	2022-02-17 23:13:23 UTC (rev 290080)
@@ -0,0 +1,4 @@
+
+
+PASS Parent frame ignores paint-timing events fired from child image rendering.
+

Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-iframe.html (from rev 290079, trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-ignore-from-subframe.html) (0 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-iframe.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-iframe.html	2022-02-17 23:13:23 UTC (rev 290080)
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<head>
+    <title>
+        Performance Paint Timing Test: Not only the top level document, paints
+        in the iframe should also generate the entry
+    </title>
+</head>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script>
+setup({"hide_test_state": true});
+async_test(function (t) {
+    assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
+    window.addEventListener('message', t.step_func(e => {
+        if (e.data.entryType == "paint" && e.data.name == "first-contentful-paint") {
+            t.done();
+        }
+    }));
+    const iframe = document.createElement('iframe');
+    iframe.src = '';
+    document.body.appendChild(iframe);
+}, 'Parent frame ignores paint-timing events fired from child image rendering.');
+</script>
+</body>
+</html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-ignore-from-subframe.html (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-ignore-from-subframe.html	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-ignore-from-subframe.html	2022-02-17 23:13:23 UTC (rev 290080)
@@ -6,12 +6,13 @@
     </title>
 </head>
 <body>
+<script src=""
 <script src=""
 <script src=""
-<script src=""
 <script>
 setup({"hide_test_state": true});
 promise_test(async t => {
+    assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
     const iframe = document.createElement('iframe');
     iframe.src = '';
     document.body.appendChild(iframe);

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-3d-rotate-expected.txt (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-3d-rotate-expected.txt	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-3d-rotate-expected.txt	2022-02-17 23:13:23 UTC (rev 290080)
@@ -1,4 +1,4 @@
 Text
 
-FAIL First contentful paint fires due to 3d rotation into view. promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: assert_precondition"
+PASS First contentful paint fires due to 3d rotation into view.
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-scale-expected.txt (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-scale-expected.txt	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-scale-expected.txt	2022-02-17 23:13:23 UTC (rev 290080)
@@ -1,3 +1,5 @@
 
-FAIL First contentful paint fires due to scale becoming positive. promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: assert_precondition"
+Harness Error (TIMEOUT), message = null
 
+TIMEOUT First contentful paint fires due to scale becoming positive. Test timed out
+

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-scale-transition-expected.txt (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-scale-transition-expected.txt	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-scale-transition-expected.txt	2022-02-17 23:13:23 UTC (rev 290080)
@@ -1,4 +1,4 @@
 TEXT
 
-FAIL First contentful paint fires when revealed during transition. promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: assert_precondition"
+PASS First contentful paint fires when revealed during transition.
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-scale.html (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-scale.html	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-scale.html	2022-02-17 23:13:23 UTC (rev 290080)
@@ -24,7 +24,17 @@
 <script src=""
 <div id="main"></div>
 <script>
-    test_fcp("First contentful paint fires due to scale becoming positive.")
+    // Load the image into memory first to make sure it's decoded.
+    function load_image() {
+      const img = document.createElement("img");
+      img.src = ""
+
+      return new Promise(resolve => {
+        img._onload_ = async () => resolve();
+      });
+    }
+
+    test_fcp("First contentful paint fires due to scale becoming positive.", load_image)
 </script>
 </body>
 </html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-text-expected.txt (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-text-expected.txt	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-text-expected.txt	2022-02-17 23:13:23 UTC (rev 290080)
@@ -1,3 +1,6 @@
+INVISIBLE
 
-FAIL First contentful paint fires due to pseudo-element becoming visible. promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: assert_precondition"
+Harness Error (TIMEOUT), message = null
 
+TIMEOUT First contentful paint fires due to pseudo-element becoming visible. Test timed out
+

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-opacity-descendant-expected.txt (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-opacity-descendant-expected.txt	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-opacity-descendant-expected.txt	2022-02-17 23:13:23 UTC (rev 290080)
@@ -1,4 +1,4 @@
 Text
 
-FAIL First contentful paint fires due to its ancestor getting positive opacity. promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: assert_precondition"
+PASS First contentful paint fires due to its ancestor getting positive opacity.
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-opacity-expected.txt (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-opacity-expected.txt	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-opacity-expected.txt	2022-02-17 23:13:23 UTC (rev 290080)
@@ -1,3 +1,5 @@
 
-FAIL First contentful paint fires due to opacity-revealed element. promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: assert_precondition"
+Harness Error (TIMEOUT), message = null
 
+TIMEOUT First contentful paint fires due to opacity-revealed element. Test timed out
+

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-opacity.html (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-opacity.html	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-opacity.html	2022-02-17 23:13:23 UTC (rev 290080)
@@ -24,7 +24,17 @@
 <script src=""
 <div id="main"></div>
 <script>
-    test_fcp("First contentful paint fires due to opacity-revealed element.");
+    // Load the image into memory first to make sure it's decoded.
+    function load_image() {
+      const img = document.createElement("img");
+      img.src = ""
+
+      return new Promise(resolve => {
+        img._onload_ = async () => resolve();
+      });
+    }
+
+    test_fcp("First contentful paint fires due to opacity-revealed element.", load_image);
 </script>
 </body>
 </html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-out-of-bounds-expected.txt (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-out-of-bounds-expected.txt	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-out-of-bounds-expected.txt	2022-02-17 23:13:23 UTC (rev 290080)
@@ -1,3 +1,5 @@
 
-FAIL First contentful paint fires due to intersection with document. promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: assert_precondition"
+Harness Error (TIMEOUT), message = null
 
+TIMEOUT First contentful paint fires due to intersection with document. Test timed out
+

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-out-of-bounds-translate-expected.txt (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-out-of-bounds-translate-expected.txt	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-out-of-bounds-translate-expected.txt	2022-02-17 23:13:23 UTC (rev 290080)
@@ -1,3 +1,5 @@
 
-FAIL First contentful paint fires due to transform-based intersection with document. promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: assert_precondition"
+Harness Error (TIMEOUT), message = null
 
+TIMEOUT First contentful paint fires due to transform-based intersection with document. Test timed out
+

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-out-of-bounds.html (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-out-of-bounds.html	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-out-of-bounds.html	2022-02-17 23:13:23 UTC (rev 290080)
@@ -23,7 +23,17 @@
 <script src=""
 <div id="main"></div>
 <script>
-    test_fcp("First contentful paint fires due to intersection with document.")
+    // Load the image into memory first to make sure it's decoded.
+    function load_image() {
+      const img = document.createElement("img");
+      img.src = ""
+
+      return new Promise(resolve => {
+        img._onload_ = async () => resolve();
+      });
+    }
+
+    test_fcp("First contentful paint fires due to intersection with document.", load_image)
 </script>
 </body>
 </html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-display-expected.txt (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-display-expected.txt	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-display-expected.txt	2022-02-17 23:13:23 UTC (rev 290080)
@@ -1,3 +1,3 @@
 
-FAIL First contentful paint fires due to pseudo-element text. promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: assert_precondition"
+PASS First contentful paint fires due to pseudo-element text.
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-image-expected.txt (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-image-expected.txt	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-image-expected.txt	2022-02-17 23:13:23 UTC (rev 290080)
@@ -1,3 +1,3 @@
 
-FAIL First contentful paint fires due to pseudo-element image. promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: assert_precondition"
+PASS First contentful paint fires due to pseudo-element image.
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-image.html (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-image.html	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-image.html	2022-02-17 23:13:23 UTC (rev 290080)
@@ -21,7 +21,17 @@
 <div id="main">
 </div>
 <script>
-    test_fcp("First contentful paint fires due to pseudo-element image.")
+    // Load the image into memory first to make sure it's decoded.
+    function load_image() {
+      const img = document.createElement("img");
+      img.src = ""
+
+      return new Promise(resolve => {
+        img._onload_ = async () => resolve();
+      });
+    }
+
+    test_fcp("First contentful paint fires due to pseudo-element image.", load_image)
 </script>
 </body>
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-opacity-expected.txt (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-opacity-expected.txt	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-opacity-expected.txt	2022-02-17 23:13:23 UTC (rev 290080)
@@ -1,3 +1,3 @@
 
-FAIL First contentful paint fires due to pseudo-element getting positive opacity. promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: assert_precondition"
+PASS First contentful paint fires due to pseudo-element getting positive opacity.
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-text-expected.txt (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-text-expected.txt	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-text-expected.txt	2022-02-17 23:13:23 UTC (rev 290080)
@@ -1,3 +1,3 @@
 
-FAIL First contentful paint fires due to pseudo-element text. promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: assert_precondition"
+PASS First contentful paint fires due to pseudo-element text.
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-visibility-expected.txt (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-visibility-expected.txt	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-visibility-expected.txt	2022-02-17 23:13:23 UTC (rev 290080)
@@ -1,3 +1,5 @@
 
-FAIL First contentful paint fires due to pseudo-element becoming visible. promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: assert_precondition"
+Harness Error (TIMEOUT), message = null
 
+TIMEOUT First contentful paint fires due to pseudo-element becoming visible. Test timed out
+

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-svg-expected.txt (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-svg-expected.txt	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-svg-expected.txt	2022-02-17 23:13:23 UTC (rev 290080)
@@ -1,3 +1,3 @@
 
-FAIL First contentful paint fires when SVG becomes contentful. promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: assert_precondition"
+PASS First contentful paint fires when SVG becomes contentful.
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-text-input-expected.txt (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-text-input-expected.txt	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-text-input-expected.txt	2022-02-17 23:13:23 UTC (rev 290080)
@@ -1,4 +1,4 @@
 
 
-FAIL Text input should become contentful when its value is non-empty promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: assert_precondition"
+PASS Text input should become contentful when its value is non-empty
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-text-input.html (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-text-input.html	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-text-input.html	2022-02-17 23:13:23 UTC (rev 290080)
@@ -8,8 +8,9 @@
 <script src=""
 <input id="input" type="text" />
 <script>
+  setup({"hide_test_state": true});
   promise_test(async t => {
-      assert_precondition(window.PerformancePaintTiming, "Paint Timing isn't supported.");
+      assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
       await new Promise(r => window.addEventListener('load', r));
       await assertNoFirstContentfulPaint(t);
       const input = document.getElementById('input');

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-typographic-pseudo-expected.txt (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-typographic-pseudo-expected.txt	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-typographic-pseudo-expected.txt	2022-02-17 23:13:23 UTC (rev 290080)
@@ -1,4 +1,4 @@
 A
 
-FAIL First contentful paint fires only when some of the text is visible, considering ::first-letter. promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: assert_precondition"
+PASS First contentful paint fires only when some of the text is visible, considering ::first-letter.
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-video-frame-expected.txt (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-video-frame-expected.txt	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-video-frame-expected.txt	2022-02-17 23:13:23 UTC (rev 290080)
@@ -1,4 +1,4 @@
 
 
-FAIL Video should become contentful when first frame is loaded promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: assert_precondition"
+PASS Video should become contentful when first frame is loaded
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-video-frame.html (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-video-frame.html	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-video-frame.html	2022-02-17 23:13:23 UTC (rev 290080)
@@ -6,15 +6,17 @@
 <script src=""
 <script src=""
 <script src=""
+<script src=""
 <video id="video" autoplay></video>
 <script>
+  setup({"hide_test_state": true});
   promise_test(async t => {
-      assert_precondition(window.PerformancePaintTiming, "Paint Timing isn't supported.");
+      assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
       await new Promise(r => window.addEventListener('load', r));
       await assertNoFirstContentfulPaint(t);
       // Set actual video content to trigger FCP.
       const video = document.getElementById('video');
-      video.setAttribute('src', '/media/test.mp4');
+      video.src = ""
       await new Promise(resolve => {
         video._oncanplay_ = resolve;
       });

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-video-poster-expected.txt (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-video-poster-expected.txt	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-video-poster-expected.txt	2022-02-17 23:13:23 UTC (rev 290080)
@@ -1,4 +1,4 @@
 
 
-FAIL Video should become contentful when poster is loaded promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: assert_precondition"
+PASS Video should become contentful when poster is loaded
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-video-poster.html (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-video-poster.html	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-video-poster.html	2022-02-17 23:13:23 UTC (rev 290080)
@@ -8,8 +8,9 @@
 <script src=""
 <video id="video" width="50" height="50"></video>
 <script>
+  setup({"hide_test_state": true});
   promise_test(async t => {
-    assert_precondition(window.PerformancePaintTiming, "Paint Timing isn't supported.");
+    assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
     await new Promise(r => window.addEventListener('load', r));
     await assertNoFirstContentfulPaint(t);
     const video = document.getElementById('video');

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-whitespace-expected.txt (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-whitespace-expected.txt	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-whitespace-expected.txt	2022-02-17 23:13:23 UTC (rev 290080)
@@ -1,3 +1,4 @@
+TEXT
 
-FAIL Whitespace should not count as contentful. promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: assert_precondition"
+PASS Whitespace should not count as contentful.
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-whitespace.html (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-whitespace.html	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-whitespace.html	2022-02-17 23:13:23 UTC (rev 290080)
@@ -29,7 +29,17 @@
     <div id="text">TEXT</div>
 </div>
 <script>
-    test_fcp("Whitespace should not count as contentful.")
+    // Load the image into memory first to make sure it's decoded.
+    function load_image() {
+      const img = document.createElement("img");
+      img.src = ""
+
+      return new Promise(resolve => {
+        img._onload_ = async () => resolve();
+      });
+    }
+
+    test_fcp("Whitespace should not count as contentful.", load_image)
 </script>
 </body>
 </html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-with-rtl-expected.txt (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-with-rtl-expected.txt	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-with-rtl-expected.txt	2022-02-17 23:13:23 UTC (rev 290080)
@@ -1,4 +1,4 @@
 TEXT
 
-FAIL FCP should fire when coordinates are negative, if within document scrollable area promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: assert_precondition"
+PASS FCP should fire when coordinates are negative, if within document scrollable area
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-with-rtl.html (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-with-rtl.html	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-with-rtl.html	2022-02-17 23:13:23 UTC (rev 290080)
@@ -10,15 +10,6 @@
   body {
     direction: rtl;
   }
-
-  #dummy {
-    background: yellow;
-    width: 10px;
-    height: 10px;
-    position: absolute;
-    left: 0;
-    top: 0;
-  }
 </style>
 </head>
 <body>
@@ -25,15 +16,14 @@
 <script src=""
 <script src=""
 <script src=""
-<div id="dummy"></div>
 <div id="text">TEXT</div>
 <script>
+  setup({"hide_test_state": true});
   promise_test(async t => {
-      assert_precondition(window.PerformancePaintTiming, "Paint Timing isn't supported.");
+      assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
       await new Promise(r => window.addEventListener('load', r));
       await assertNoFirstContentfulPaint(t);
       document.body.style.direction = 'ltr'
-      document.getElementById('dummy').style.background = ''
       await assertFirstContentfulPaint(t);
   }, 'FCP should fire when coordinates are negative, if within document scrollable area');
 </script>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/svg-in-iframe-expected.txt (0 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/svg-in-iframe-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/svg-in-iframe-expected.txt	2022-02-17 23:13:23 UTC (rev 290080)
@@ -0,0 +1,6 @@
+
+
+Harness Error (TIMEOUT), message = null
+
+TIMEOUT SVG in an iframe does not trigger FCP in the main frame Test timed out
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/svg-in-iframe.html (0 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/svg-in-iframe.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/svg-in-iframe.html	2022-02-17 23:13:23 UTC (rev 290080)
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<title>Performance Paint Timing Test: SVG in iframe does not trigger FCP</title>
+<script src=""
+<script src=""
+<script src=""
+<iframe src=""
+<script>
+  promise_test(async (t) => {
+    await new Promise(resolve => {
+      window.addEventListener("message", resolve);
+    });
+    return assertNoFirstContentfulPaint(t);
+  }, "SVG in an iframe does not trigger FCP in the main frame");
+</script>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/resources/svg.html (0 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/resources/svg.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/resources/svg.html	2022-02-17 23:13:23 UTC (rev 290080)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<div id="main">
+  <svg viewBox="0 0 10 10">
+    <defs>
+      <circle id="myCircle" cx="5" cy="5" r="4" stroke="blue" />
+    </defs>
+    <use id="circle" href="" fill="green" />
+  </svg>
+</div>
+<script>
+  const observer = new PerformanceObserver(list => {
+    const fcp = list.getEntriesByName("first-contentful-paint");
+    if (!fcp.length)
+      return;
+
+    // Message the parent when FCP has been reached.
+    parent.postMessage("GotFCP", '*');
+  });
+  observer.observe({ type: "paint", buffered: true });
+</script>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/resources/utils.js (290079 => 290080)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/resources/utils.js	2022-02-17 22:58:31 UTC (rev 290079)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/paint-timing/resources/utils.js	2022-02-17 23:13:23 UTC (rev 290080)
@@ -25,7 +25,7 @@
       if (performance.getEntriesByName('first-contentful-paint').length === 1) {
         resolve();
       } else {
-        requestAnimationFrame(checkFCP)
+        t.step_timeout(checkFCP, 0);
       }
     }
     t.step(checkFCP);
@@ -32,16 +32,20 @@
   });
 }
 
-async function test_fcp(label) {
+async function test_fcp(label, before_assert_fcp_func) {
+  setup({"hide_test_state": true});
   const style = document.createElement('style');
   document.head.appendChild(style);
   await promise_test(async t => {
-    assert_precondition(window.PerformancePaintTiming, "Paint Timing isn't supported.");
+    assert_implements(window.PerformancePaintTiming, "Paint Timing isn't supported.");
     const main = document.getElementById('main');
     await new Promise(r => window.addEventListener('load', r));
     await assertNoFirstContentfulPaint(t);
     main.className = 'preFCP';
     await assertNoFirstContentfulPaint(t);
+    if (before_assert_fcp_func) {
+      await before_assert_fcp_func();
+    }
     main.className = 'contentful';
     await assertFirstContentfulPaint(t);
   }, label);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to