LibWeb: Add stroke-linecap attribute and plumb it to SVGGraphicsElement

SVGGraphicsElement then goes ahead and does nothing with it for now.
This commit is contained in:
Nico Weber 2024-10-10 10:15:49 -04:00 committed by Tim Ledbetter
commit cc0cfd044b
Notes: github-actions[bot] 2024-10-10 23:28:42 +00:00
11 changed files with 41 additions and 1 deletions

View file

@ -144,6 +144,7 @@ public:
static float fill_opacity() { return 1.0f; }
static CSS::FillRule fill_rule() { return CSS::FillRule::Nonzero; }
static CSS::ClipRule clip_rule() { return CSS::ClipRule::Nonzero; }
static CSS::StrokeLinecap stroke_linecap() { return CSS::StrokeLinecap::Butt; }
static float stroke_opacity() { return 1.0f; }
static float stop_opacity() { return 1.0f; }
static CSS::TextAnchor text_anchor() { return CSS::TextAnchor::Start; }
@ -464,6 +465,7 @@ public:
CSS::FillRule fill_rule() const { return m_inherited.fill_rule; }
Optional<SVGPaint> const& stroke() const { return m_inherited.stroke; }
float fill_opacity() const { return m_inherited.fill_opacity; }
CSS::StrokeLinecap stroke_linecap() const { return m_inherited.stroke_linecap; }
float stroke_opacity() const { return m_inherited.stroke_opacity; }
LengthPercentage const& stroke_width() const { return m_inherited.stroke_width; }
Color stop_color() const { return m_noninherited.stop_color; }
@ -555,6 +557,7 @@ protected:
CSS::FillRule fill_rule { InitialValues::fill_rule() };
Optional<SVGPaint> stroke;
float fill_opacity { InitialValues::fill_opacity() };
CSS::StrokeLinecap stroke_linecap { InitialValues::stroke_linecap() };
float stroke_opacity { InitialValues::stroke_opacity() };
LengthPercentage stroke_width { Length::make_px(1) };
CSS::TextAnchor text_anchor { InitialValues::text_anchor() };
@ -791,6 +794,7 @@ public:
void set_stroke(SVGPaint value) { m_inherited.stroke = value; }
void set_fill_rule(CSS::FillRule value) { m_inherited.fill_rule = value; }
void set_fill_opacity(float value) { m_inherited.fill_opacity = value; }
void set_stroke_linecap(CSS::StrokeLinecap value) { m_inherited.stroke_linecap = value; }
void set_stroke_opacity(float value) { m_inherited.stroke_opacity = value; }
void set_stroke_width(LengthPercentage value) { m_inherited.stroke_width = value; }
void set_stop_color(Color value) { m_noninherited.stop_color = value; }