mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-20 09:21:55 +00:00
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:
parent
eafcd82e82
commit
421cf8d9bf
Notes:
github-actions[bot]
2024-10-29 22:37:55 +00:00
Author: https://github.com/nico
Commit: 421cf8d9bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2030
Reviewed-by: https://github.com/AtkinsSJ ✅
10 changed files with 80 additions and 1 deletions
|
@ -150,6 +150,8 @@ void SVGGraphicsElement::apply_presentational_hints(CSS::StyleProperties& style)
|
|||
// FIXME: The `stroke` attribute and CSS `stroke` property are not the same! But our support is limited enough that they are equivalent for now.
|
||||
NamedPropertyID(CSS::PropertyID::Stroke),
|
||||
NamedPropertyID(CSS::PropertyID::StrokeLinecap),
|
||||
NamedPropertyID(CSS::PropertyID::StrokeLinejoin),
|
||||
NamedPropertyID(CSS::PropertyID::StrokeMiterlimit),
|
||||
NamedPropertyID(CSS::PropertyID::StrokeWidth),
|
||||
NamedPropertyID(CSS::PropertyID::FillRule),
|
||||
NamedPropertyID(CSS::PropertyID::FillOpacity),
|
||||
|
@ -242,6 +244,20 @@ Optional<CSS::StrokeLinecap> SVGGraphicsElement::stroke_linecap() const
|
|||
return layout_node()->computed_values().stroke_linecap();
|
||||
}
|
||||
|
||||
Optional<CSS::StrokeLinejoin> SVGGraphicsElement::stroke_linejoin() const
|
||||
{
|
||||
if (!layout_node())
|
||||
return {};
|
||||
return layout_node()->computed_values().stroke_linejoin();
|
||||
}
|
||||
|
||||
Optional<CSS::NumberOrCalculated> SVGGraphicsElement::stroke_miterlimit() const
|
||||
{
|
||||
if (!layout_node())
|
||||
return {};
|
||||
return layout_node()->computed_values().stroke_miterlimit();
|
||||
}
|
||||
|
||||
Optional<float> SVGGraphicsElement::stroke_opacity() const
|
||||
{
|
||||
if (!layout_node())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue