LibWeb/Painting: Paint ridge and groove border styles

This commit is contained in:
Sam Atkins 2025-08-04 17:21:50 +01:00
commit 5f986b2c33
Notes: github-actions[bot] 2025-08-11 10:08:20 +00:00
7 changed files with 53 additions and 2 deletions

View file

@ -192,8 +192,11 @@ void paint_border(DisplayListRecorder& painter, BorderEdge edge, DevicePixelRect
}
case CSS::LineStyle::Groove:
case CSS::LineStyle::Ridge:
// FIXME: Implement these
break;
// Two half-width borders
paint_double_border(0.5f,
border_style == CSS::LineStyle::Groove ? CSS::LineStyle::Inset : CSS::LineStyle::Outset,
border_style == CSS::LineStyle::Groove ? CSS::LineStyle::Outset : CSS::LineStyle::Inset);
return;
}
struct Points {

View file

@ -0,0 +1,10 @@
<!DOCTYPE html>
<style>
* {
margin: 0;
}
body {
background-color: white;
}
</style>
<img src="../images/css-border-style-groove-ref.png">

View file

@ -0,0 +1,10 @@
<!DOCTYPE html>
<style>
* {
margin: 0;
}
body {
background-color: white;
}
</style>
<img src="../images/css-border-style-ridge-ref.png">

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

View file

@ -0,0 +1,14 @@
<!doctype html>
<link rel="match" href="../expected/css-border-style-groove-ref.html" />
<meta name="fuzzy" content="maxDifference=0-2;totalPixels=0-259">
<style>
div {
width: 200px;
height: 200px;
border-style: groove;
border-radius: 30px / 50px;
border-width: 6px 12px 18px 24px;
border-color: red yellow green blue;
}
</style>
<div></div>

View file

@ -0,0 +1,14 @@
<!doctype html>
<link rel="match" href="../expected/css-border-style-ridge-ref.html" />
<meta name="fuzzy" content="maxDifference=0-2;totalPixels=0-260">
<style>
div {
width: 200px;
height: 200px;
border-style: ridge;
border-radius: 30px / 50px;
border-width: 6px 12px 18px 24px;
border-color: red yellow green blue;
}
</style>
<div></div>