https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 98cc5c8bb77ef18be9c4464c8e66873654ade128 authored by Chris Lilley on 11 April 2018, 09:30:00 UTC
quick test to see if descriptor supported anywhere
Tip revision: 98cc5c8
2d.shadow.composite.1.html
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
<title>OffscreenCanvas test: 2d.shadow.composite.1</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/canvas-tests.js"></script>

<h1>2d.shadow.composite.1</h1>
<p class="desc">Shadows are drawn using globalCompositeOperation</p>


<script>
var t = async_test("Shadows are drawn using globalCompositeOperation");
t.step(function() {

var offscreenCanvas = new OffscreenCanvas(100, 50);
var ctx = offscreenCanvas.getContext('2d');

ctx.fillStyle = '#f00';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'xor';
ctx.shadowColor = '#f00';
ctx.shadowOffsetX = 100;
ctx.fillStyle = '#0f0';
ctx.fillRect(-100, 0, 200, 50);
_assertPixelApprox(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);

t.done();

});
</script>
back to top