diff options
author | Andreas Kling <kling@serenityos.org> | 2023-04-18 18:56:06 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-04-19 07:52:26 +0200 |
commit | ec5d5918c4f9f6e389f16154e24450a2bb170876 (patch) | |
tree | d5e40bb562d0f741c5cf8c55574d18e76a95d74f /Userland/Libraries/LibWeb/Painting | |
parent | 0e8ef1b8862a7acd3edfedb9b19f1ca2cb837220 (diff) | |
download | serenity-ec5d5918c4f9f6e389f16154e24450a2bb170876.zip |
LibWeb: Make SVG <g> elements generate a SVGGraphicsPaintable
...instead of defaulting to a PaintableBox. This way it gets the same
behavior as other SVG boxes during paint.
Diffstat (limited to 'Userland/Libraries/LibWeb/Painting')
-rw-r--r-- | Userland/Libraries/LibWeb/Painting/SVGGraphicsPaintable.cpp | 5 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/Painting/SVGGraphicsPaintable.h | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Painting/SVGGraphicsPaintable.cpp b/Userland/Libraries/LibWeb/Painting/SVGGraphicsPaintable.cpp index 52e5e06c79..cceaeb3cab 100644 --- a/Userland/Libraries/LibWeb/Painting/SVGGraphicsPaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/SVGGraphicsPaintable.cpp @@ -9,6 +9,11 @@ namespace Web::Painting { +JS::NonnullGCPtr<SVGGraphicsPaintable> SVGGraphicsPaintable::create(Layout::SVGGraphicsBox const& layout_box) +{ + return layout_box.heap().allocate_without_realm<SVGGraphicsPaintable>(layout_box); +} + SVGGraphicsPaintable::SVGGraphicsPaintable(Layout::SVGGraphicsBox const& layout_box) : SVGPaintable(layout_box) { diff --git a/Userland/Libraries/LibWeb/Painting/SVGGraphicsPaintable.h b/Userland/Libraries/LibWeb/Painting/SVGGraphicsPaintable.h index 61c7ad01b0..ee811b7c52 100644 --- a/Userland/Libraries/LibWeb/Painting/SVGGraphicsPaintable.h +++ b/Userland/Libraries/LibWeb/Painting/SVGGraphicsPaintable.h @@ -15,6 +15,8 @@ class SVGGraphicsPaintable : public SVGPaintable { JS_CELL(SVGGraphicsPaintable, SVGPaintable); public: + static JS::NonnullGCPtr<SVGGraphicsPaintable> create(Layout::SVGGraphicsBox const&); + virtual void before_children_paint(PaintContext&, PaintPhase) const override; Layout::SVGGraphicsBox const& layout_box() const; |