mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
LibWeb: Add screenshot test for canvas-shadow
This commit is contained in:
parent
34f7bf979d
commit
e537adad77
Notes:
github-actions[bot]
2024-10-23 18:44:49 +00:00
Author: https://github.com/uysalibov Commit: https://github.com/LadybirdBrowser/ladybird/commit/e537adad772 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1848 Reviewed-by: https://github.com/kalenikaliaksandr ✅
3 changed files with 39 additions and 0 deletions
30
Tests/LibWeb/Screenshot/canvas-shadow.html
Normal file
30
Tests/LibWeb/Screenshot/canvas-shadow.html
Normal file
|
@ -0,0 +1,30 @@
|
|||
<link rel="match" href="reference/canvas-shadow-ref.html" />
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: white;
|
||||
}
|
||||
</style>
|
||||
<canvas width=800 height=600></canvas>
|
||||
<script>
|
||||
const canvas = document.querySelector("canvas");
|
||||
const ctx = canvas.getContext("2d");
|
||||
|
||||
// Shadow
|
||||
ctx.shadowColor = "LightCoral";
|
||||
ctx.shadowOffsetX = 15;
|
||||
ctx.shadowOffsetY = 15;
|
||||
|
||||
// Filled rectangle
|
||||
ctx.fillStyle = "red";
|
||||
ctx.fillRect(20, 10, 100, 100);
|
||||
|
||||
|
||||
// Stroked rectangle
|
||||
ctx.lineWidth = 4;
|
||||
ctx.strokeStyle = "red";
|
||||
ctx.strokeRect(170, 10, 100, 100);
|
||||
</script>
|
BIN
Tests/LibWeb/Screenshot/images/canvas-shadow-ref.png
Normal file
BIN
Tests/LibWeb/Screenshot/images/canvas-shadow-ref.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
9
Tests/LibWeb/Screenshot/reference/canvas-shadow-ref.html
Normal file
9
Tests/LibWeb/Screenshot/reference/canvas-shadow-ref.html
Normal file
|
@ -0,0 +1,9 @@
|
|||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
}
|
||||
body {
|
||||
background-color: white;
|
||||
}
|
||||
</style>
|
||||
<img src="../images/canvas-shadow-ref.png">
|
Loading…
Reference in a new issue