Files
firefox/testing/web-platform/tests/css/css-paint-api/paint2d-composite.https.html
Robert Flack ee1c140dbd Bug 2030451 [wpt PR 59020] - Re-enable virtual/off-main-thread-css-paint/ tests, a=testonly
Automatic update from web-platform-tests
Re-enable virtual/off-main-thread-css-paint/ tests

I suspect that due to paint holding two requestAnimationFrames was not
consistently enough time to ensure a drawn frame. However, in other tests we use the starting of a composited animation to know when we
have for sure drawn a new main frame. By applying the same technique
for paint worklet we can re-enable these tests without the same
flakiness.

Bug: 355693577
Change-Id: I104f229257dc8fa051f8bf6c3c1e569ff2cbe48a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7726989
Reviewed-by: Vladimir Levin <[email protected]>
Commit-Queue: Robert Flack <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1610775}

--

wpt-commits: e2d58307df0b8139854ad974ef2e4908d2a62baa
wpt-pr: 59020
2026-04-23 10:07:57 +00:00

76 lines
2.1 KiB
HTML

<!DOCTYPE html>
<html class="reftest-wait">
<link rel="help" href="https://drafts.css-houdini.org/css-paint-api/">
<link rel="match" href="paint2d-composite-ref.html">
<meta name="fuzzy" content="maxDifference=0-64;totalPixels=0-1000">
<style>
div {
display: inline-block;
width: 80px;
height: 80px;
}
#source-over { background-image: paint(source-over); }
#source-in { background-image: paint(source-in); }
#source-out { background-image: paint(source-out); }
#source-atop { background-image: paint(source-atop); }
#destination-over { background-image: paint(destination-over); }
#destination-in { background-image: paint(destination-in); }
#destination-out { background-image: paint(destination-out); }
#destination-atop { background-image: paint(destination-atop); }
#lighter { background-image: paint(lighter); }
#xor { background-image: paint(xor); }
</style>
<script src="/common/reftest-wait.js"></script>
<script src="/common/worklet-reftest.js"></script>
<body>
<div id="source-over"></div>
<div id="source-in"></div>
<div id="source-out"></div>
<div id="source-atop"></div>
<br>
<div id="destination-over"></div>
<div id="destination-in"></div>
<div id="destination-out"></div>
<div id="destination-atop"></div>
<br>
<div id="lighter"></div>
<div id="xor"></div>
<script id="code" type="text/worklet">
var compositeOps = [
'source-over',
'source-in',
'source-out',
'source-atop',
'destination-over',
'destination-in',
'destination-out',
'destination-atop',
'lighter',
'xor'
];
function doPaint(ctx, op) {
ctx.fillStyle = 'red';
ctx.fillRect(5, 5, 40, 40);
ctx.globalCompositeOperation = op;
ctx.fillStyle = 'deepskyblue';
ctx.beginPath();
ctx.arc(45,45,20,0,Math.PI*2,true);
ctx.fill();
}
for (var i = 0; i < compositeOps.length; i++) {
let op = compositeOps[i];
registerPaint(op, class { paint(ctx, geom) { doPaint(ctx, op); } });
}
</script>
<script>
importWorkletAndTerminateTestAfterAsyncPaint(CSS.paintWorklet, document.getElementById('code').textContent);
</script>
</body>
</html>