LibWeb: Parse stroke-{linejoin,miterlimit} attributes

Similar to LadybirdBrowser/ladybird#1714.

We don't implement the linejoin values `miter-clip` and `arcs`, because
according to the SVG 2 spec:

> The values miter-clip and arcs of the stroke-linejoin property are at
> risk. There are no known browser implementations. See issue Github
> issue w3c/svgwg#592.

Nothing uses this yet. The next step is to change
SVGPathPaintable::paint() to read `graphics_element.stroke_linejoin()`
and `graphics_element.stroke_miterlimit()` when painting.
This commit is contained in:
Nico Weber 2024-10-28 20:51:16 -04:00 committed by Sam Atkins
commit 421cf8d9bf
Notes: github-actions[bot] 2024-10-29 22:37:55 +00:00
10 changed files with 80 additions and 1 deletions

View file

@ -849,6 +849,11 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& computed_style)
computed_values.set_fill_opacity(computed_style.fill_opacity());
if (auto stroke_linecap = computed_style.stroke_linecap(); stroke_linecap.has_value())
computed_values.set_stroke_linecap(stroke_linecap.value());
if (auto stroke_linejoin = computed_style.stroke_linejoin(); stroke_linejoin.has_value())
computed_values.set_stroke_linejoin(stroke_linejoin.value());
computed_values.set_stroke_miterlimit(computed_style.stroke_miterlimit());
computed_values.set_stroke_opacity(computed_style.stroke_opacity());
computed_values.set_stop_opacity(computed_style.stop_opacity());