mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-01 15:18:06 +00:00
LibWeb: Move SVGPathElement methods into SVGGeometryElement
From the spec: > Interface SVGGeometryElement represents SVG elements whose rendering > is defined by geometry with an equivalent path, and which can be > filled and stroked. This includes paths and the basic shapes. - https://svgwg.org/svg2-draft/types.html#InterfaceSVGGeometryElement Making them all create an SVGPathBox, and return a Path from get_path(), means we can implement the "basic shapes" using the path system we already have. :^)
This commit is contained in:
parent
49fe232bc7
commit
326a5a82eb
Notes:
sideshowbarker
2024-07-17 19:00:58 +09:00
Author: https://github.com/AtkinsSJ
Commit: 326a5a82eb
Pull-request: https://github.com/SerenityOS/serenity/pull/12444
Reviewed-by: https://github.com/awesomekling
6 changed files with 22 additions and 18 deletions
|
@ -7,17 +7,17 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibWeb/Layout/SVGGraphicsBox.h>
|
||||
#include <LibWeb/SVG/SVGPathElement.h>
|
||||
#include <LibWeb/SVG/SVGGeometryElement.h>
|
||||
|
||||
namespace Web::Layout {
|
||||
|
||||
class SVGPathBox final : public SVGGraphicsBox {
|
||||
public:
|
||||
SVGPathBox(DOM::Document&, SVG::SVGPathElement&, NonnullRefPtr<CSS::StyleProperties>);
|
||||
SVGPathBox(DOM::Document&, SVG::SVGGeometryElement&, NonnullRefPtr<CSS::StyleProperties>);
|
||||
virtual ~SVGPathBox() override = default;
|
||||
|
||||
SVG::SVGPathElement& dom_node() { return verify_cast<SVG::SVGPathElement>(SVGGraphicsBox::dom_node()); }
|
||||
SVG::SVGPathElement const& dom_node() const { return verify_cast<SVG::SVGPathElement>(SVGGraphicsBox::dom_node()); }
|
||||
SVG::SVGGeometryElement& dom_node() { return verify_cast<SVG::SVGGeometryElement>(SVGGraphicsBox::dom_node()); }
|
||||
SVG::SVGGeometryElement const& dom_node() const { return verify_cast<SVG::SVGGeometryElement>(SVGGraphicsBox::dom_node()); }
|
||||
|
||||
virtual void paint(PaintContext& context, PaintPhase phase) override;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue