Bug 1794662 [wpt PR 36401] - Batch-remove unused arguments in _assertPixel and _asser...
[gecko.git] / testing / web-platform / tests / html / canvas / offscreen / compositing / 2d.composite.uncovered.fill.destination-in.html
blob0f069372ad141c3e4c4099d6c032ec2342d1cb3c
1 <!DOCTYPE html>
2 <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
3 <title>OffscreenCanvas test: 2d.composite.uncovered.fill.destination-in</title>
4 <meta name="timeout" content="long">
5 <script src="/resources/testharness.js"></script>
6 <script src="/resources/testharnessreport.js"></script>
7 <script src="/html/canvas/resources/canvas-tests.js"></script>
9 <h1>2d.composite.uncovered.fill.destination-in</h1>
10 <p class="desc">fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
13 <script>
14 var t = async_test("fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.");
15 var t_pass = t.done.bind(t);
16 var t_fail = t.step_func(function(reason) {
17 throw reason;
18 });
19 t.step(function() {
21 var canvas = new OffscreenCanvas(100, 50);
22 var ctx = canvas.getContext('2d');
25 ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
26 ctx.fillRect(0, 0, 100, 50);
27 ctx.globalCompositeOperation = 'destination-in';
28 ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
29 ctx.translate(0, 25);
30 ctx.fillRect(0, 50, 100, 50);
31 _assertPixelApprox(canvas, 50,25, 0,0,0,0, 5);
32 t.done();
34 });
35 </script>