mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-04 18:23:39 +00:00
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.
35 lines
862 B
C++
35 lines
862 B
C++
/*
|
|
* Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
|
|
* Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibGfx/Path.h>
|
|
#include <LibWeb/DOM/Node.h>
|
|
#include <LibWeb/SVG/SVGElement.h>
|
|
#include <LibWeb/SVG/TagNames.h>
|
|
|
|
namespace Web::SVG {
|
|
|
|
class SVGGraphicsElement : public SVGElement {
|
|
public:
|
|
using WrapperType = Bindings::SVGGraphicsElementWrapper;
|
|
|
|
SVGGraphicsElement(DOM::Document&, QualifiedName);
|
|
|
|
virtual void parse_attribute(FlyString const& name, String const& value) override;
|
|
|
|
Optional<Gfx::Color> fill_color() const;
|
|
Optional<Gfx::Color> stroke_color() const;
|
|
Optional<float> stroke_width() const;
|
|
|
|
protected:
|
|
Optional<Gfx::Color> m_fill_color;
|
|
Optional<Gfx::Color> m_stroke_color;
|
|
Optional<float> m_stroke_width;
|
|
};
|
|
|
|
}
|