mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02:00
Instead of rendering a reference HTML page that wraps an <img> tag pointing to a PNG, Screenshot tests now load the expected PNG directly from disk and compare it against the rendered screenshot. This eliminates the indirection of loading and rendering a second page just to display a static image. This also means --rebaseline now works for Screenshot tests, generating the expected PNG automatically instead of requiring manual screenshot capture and placement. Changes: - Add TestMode::Screenshot with its own collector and runner - Move PNGs from Screenshot/images/ to Screenshot/expected/ with normalized names matching input filenames - Remove all 92 reference HTML wrapper files and the images/ directory - Remove <link rel="match"> from all 94 Screenshot input HTML files - Update add_libweb_test.py Screenshot boilerplate accordingly - Add Screenshot mode to results viewer image comparison tabs
39 lines
1013 B
HTML
39 lines
1013 B
HTML
<!DOCTYPE html>
|
|
<meta name="fuzzy" content="maxDifference=0-5;totalPixels=0-567">
|
|
<style>
|
|
canvas {
|
|
border: 1px solid black;
|
|
image-rendering: pixelated;
|
|
}
|
|
</style>
|
|
<canvas id="canvas" width="550" height="325"></canvas>
|
|
<script>
|
|
const canvas = document.getElementById("canvas")
|
|
|
|
const context = canvas.getContext("2d");
|
|
context.beginPath();
|
|
context.arc(59, 55, 38, 5.3849570248895775, 2.9421639085067177);
|
|
context.stroke();
|
|
context.fill();
|
|
|
|
context.beginPath();
|
|
context.ellipse(20,20,15,8,1.2273132071162383,4.1926143018618225,2.8853539230051624);
|
|
context.stroke();
|
|
context.fill();
|
|
|
|
for (let i = 0; i < 2; i++) {
|
|
for (let j = -5; j <= 5; j++) {
|
|
context.beginPath();
|
|
let x = 25 + (j + 5) * 50;
|
|
let y = 150 + i * 50;
|
|
let radius = 20;
|
|
let startAngle = 0;
|
|
let endAngle = (Math.PI * j) / 2;
|
|
let counterclockwise = i == 1;
|
|
|
|
context.arc(x, y, radius, startAngle, endAngle, counterclockwise);
|
|
context.stroke();
|
|
}
|
|
}
|
|
</script>
|