Skip to content

Commit

Permalink
css-shapes: Fix flakiness of shape-image-029.html
Browse files Browse the repository at this point in the history
Wait until 'support/left-half-rectangle.png' loaded.

Bug: 372252514, 372756068
Change-Id: I106ab5e4de34be91f4365129011aec58f19c936a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5923354
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Auto-Submit: Kent Tamura <tkent@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1367293}
  • Loading branch information
tkent-google authored and chromium-wpt-export-bot committed Oct 11, 2024
1 parent 8903062 commit 4630a18
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions css/css-shapes/shape-outside/shape-image/shape-image-029.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!DOCTYPE html>
<html class="reftest-wait">
<link rel="help" href="https://drafts.csswg.org/css-shapes-2/#shapes-from-image"/>
<link rel="help" href="https://drafts.csswg.org/css-shapes-2/#shape-outside-property"/>
<meta name="flags" content="ahem"/>
Expand Down Expand Up @@ -42,3 +43,20 @@
XXXXXX
XXXXXX
</div>

<script>
// A workaround of an issue of Chromium content_shell. It finishes a test
// without waiting images linked from url(). crbug.com/372756068
const image = new Image();
image.src = 'support/left-half-rectangle.png';
image.addEventListener('load', () => {
image.remove();
requestAnimationFrame(() => {
requestAnimationFrame(() => {
document.documentElement.classList.remove('reftest-wait');
});
});
});
document.body.appendChild(image);
</script>
</html>

0 comments on commit 4630a18

Please sign in to comment.