Files
firefox/testing/web-platform/tests/css/css-paint-api/paint2d-gradient.https.html
T
Xida Chen bce3233fcf Bug 1692511 [wpt PR 27611] - Fix paint2d-gradient.https.html, a=testonly
Automatic update from web-platform-tests
Fix paint2d-gradient.https.html

The test has a linear gradient, together with OOP-R enabled
everyone, it seems we have very subtle pixel difference where
human eyes cannot see. Here is a picture shows what the diff
looks like:
https://drive.google.com/file/d/15dU0JLc2lj00J_eoN6PQQ3lZMpymQrMm/view?usp=sharing

I changed the test to be fuzzy matching, this should fix the
test. The fix is this line:
<meta name=fuzzy content="0-5;3000-4000">

It means that when there is a pixel diff, the diff for each
color channel is between 0-5. And there are 3000-4000 pixels
diff.

Bug: 1034807
Change-Id: Iae83f00815c4231c1073a812e7f62f3abe3e4c5e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2692506
Reviewed-by: Kevin Ellis <[email protected]>
Commit-Queue: Xida Chen <[email protected]>
Cr-Commit-Position: refs/heads/master@{#853600}

--

wpt-commits: 2d2308f7f690c310e542dcac941eb2c86a64c7c0
wpt-pr: 27611
2021-02-16 12:57:38 +00:00

43 lines
1.3 KiB
HTML

<!DOCTYPE html>
<html class="reftest-wait">
<meta name=fuzzy content="0-5;3000-4000">
<link rel="help" href="https://drafts.css-houdini.org/css-paint-api/">
<link rel="match" href="paint2d-gradient-ref.html">
<style>
#output {
width: 200px;
height: 100px;
background-image: paint(gradients);
}
</style>
<script src="/common/reftest-wait.js"></script>
<script src="/common/worklet-reftest.js"></script>
<body>
<div id="output"></div>
<script id="code" type="text/worklet">
registerPaint('gradients', class {
paint(ctx, geom) {
var linearGradient = ctx.createLinearGradient(0, 0, 100, 100);
linearGradient.addColorStop(0, 'blue');
linearGradient.addColorStop(0.5, 'red');
linearGradient.addColorStop(1, 'white');
ctx.fillStyle = linearGradient;
ctx.fillRect(0, 0, 100, 100);
var radialGradient = ctx.createRadialGradient(150, 50, 0, 150, 50, 50);
radialGradient.addColorStop(0, 'blue');
radialGradient.addColorStop(0.5, 'red');
radialGradient.addColorStop(1, 'white');
ctx.fillStyle = radialGradient;
ctx.fillRect(100, 0, 100, 100);
}
});
</script>
<script>
importWorkletAndTerminateTestAfterAsyncPaint(CSS.paintWorklet, document.getElementById('code').textContent);
</script>
</body>
</html>