diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2021-09-16 12:28:14 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-16 22:30:33 +0200 |
commit | 3964b81d2b5458c0c4fb102929d3aae61f86feed (patch) | |
tree | f83daf24fd26eeb42544edc2dfc916a649e4c50f /Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.h | |
parent | 2c8c56684bdf9e7716b21e7e133f37db2da24308 (diff) | |
download | serenity-3964b81d2b5458c0c4fb102929d3aae61f86feed.zip |
LibWeb: Add for CSS `fill/stroke/stroke-color` properties for SVG
In the spec, `fill` and `stroke` are supposed to be a shorthands for
various properties. But since the spec is still a working draft, and
neither Firefox or Chrome support the `fill-color` or `stroke-color`
properties, we'll stick with `fill` and `stroke` as simple colors for
now.
Also, note that SVG expects things in "user units", and we are assuming
that 1px = 1 user unit for now.
Diffstat (limited to 'Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.h')
-rw-r--r-- | Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.h b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.h index cce0b414f2..58019e67a9 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org> + * Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org> * * SPDX-License-Identifier: BSD-2-Clause */ @@ -19,11 +20,11 @@ public: SVGGraphicsElement(DOM::Document&, QualifiedName); - virtual void parse_attribute(const FlyString& name, const String& value) override; + virtual void parse_attribute(FlyString const& name, String const& value) override; - const Optional<Gfx::Color>& fill_color() const { return m_fill_color; } - const Optional<Gfx::Color>& stroke_color() const { return m_stroke_color; } - const Optional<float>& stroke_width() const { return m_stroke_width; } + Optional<Gfx::Color> fill_color() const; + Optional<Gfx::Color> stroke_color() const; + Optional<float> stroke_width() const; protected: Optional<Gfx::Color> m_fill_color; |