summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/canvas/element/manual/filters/canvas-filter-shadow-and-properties.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/canvas/element/manual/filters/canvas-filter-shadow-and-properties.html')
-rw-r--r--testing/web-platform/tests/html/canvas/element/manual/filters/canvas-filter-shadow-and-properties.html20
1 files changed, 20 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/canvas/element/manual/filters/canvas-filter-shadow-and-properties.html b/testing/web-platform/tests/html/canvas/element/manual/filters/canvas-filter-shadow-and-properties.html
new file mode 100644
index 0000000000..2057b95c3e
--- /dev/null
+++ b/testing/web-platform/tests/html/canvas/element/manual/filters/canvas-filter-shadow-and-properties.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<link rel="match" href="canvas-filter-shadow-and-properties-expected.html"/>
+<body>
+ <canvas id="canvas" width="300" height="300"></canvas>
+</body>
+<script>
+ /*
+ The expected behavior when both shadow properties and filters are used at the
+ same time is that the filter is applied to the elements drawn and the shadow
+ properties create another shadow that includes even shadows of the
+ filter-generated shadows.
+ */
+ var canvas = document.getElementById('canvas');
+ var ctx = canvas.getContext('2d');
+ ctx.shadowColor = 'cyan';
+ ctx.shadowOffsetX = 20;
+ ctx.shadowOffsetY = 20;
+ ctx.filter = 'drop-shadow(10px 10px 0 red)';
+ ctx.fillRect(10, 10, 50, 50);
+</script>