ladybird/Tests/LibWeb/Screenshot/input/canvas-fillstyle-rgb.html
Sam Atkins b7efb61fbe
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
Tests/LibWeb: Restructure Ref and Screenshot test dirs to match others
Now each test type has the same directories:
- input
- expected
- data

Also, tests can be in subdirectories within ./input.
2024-11-05 14:02:07 +00:00

35 lines
910 B
HTML

<link rel="match" href="../expected/canvas-fillstyle-rgb-ref.html" />
<style>
* {
margin: 0;
}
body {
background-color: white;
}
</style>
<canvas width=500 height=500></canvas>
<script type="text/javascript">
const canvas = document.querySelector("canvas");
const ctx = canvas.getContext("2d");
// Integer numbers
ctx.fillStyle = "rgb(0,255,0)";
ctx.fillRect(0, 0, 500, 100);
// Decimal numbers
ctx.fillStyle = "rgb(254.56022744510793,0.28813966673057,0.2973971574794)";
ctx.fillRect(0, 100, 500, 100);
// Numbers below 0 and above 255 should be clamped
ctx.fillStyle = "rgba(-50,-50,500,1)";
ctx.fillRect(0, 200, 500, 100);
// Percentages
ctx.fillStyle = "rgb(0%, 100%, 0%)";
ctx.fillRect(0, 300, 500, 100);
// Calc
ctx.fillStyle = "rgb(calc(infinity), 0, 0)";
ctx.fillRect(0, 400, 500, 100);
</script>