Quellcode durchsuchen

Tests: Add screenshot test for Canvas2D fillstyle opacity

Lucien Fiorini vor 7 Monaten
Ursprung
Commit
b909e3d587

+ 11 - 0
Tests/LibWeb/Screenshot/expected/canvas-fillstyle-opacity-ref.html

@@ -0,0 +1,11 @@
+<style>
+    * {
+        margin: 0;
+    }
+
+    body {
+        background-color: white;
+    }
+</style>
+
+<img src="../images/canvas-fillstyle-opacity.png">

BIN
Tests/LibWeb/Screenshot/images/canvas-fillstyle-opacity.png


+ 19 - 0
Tests/LibWeb/Screenshot/input/canvas-fillstyle-opacity.html

@@ -0,0 +1,19 @@
+<link rel="match" href="../expected/canvas-fillstyle-opacity-ref.html" />
+
+<style>
+    * {
+        margin: 0;
+    }
+    body {
+        background-color: white;
+    }
+</style>
+
+<canvas id="myCanvas" width="200" height="200"></canvas>
+
+<script>
+    const canvas = document.getElementById('myCanvas');
+    const ctx = canvas.getContext('2d');
+    ctx.fillStyle = 'rgba(0, 0, 255, 0.5)';
+    ctx.fillRect(50, 50, 100, 100);
+</script>