summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorK-Adam <kecskes.adam@outlook.com>2021-08-01 16:30:18 +0200
committerAndreas Kling <kling@serenityos.org>2021-08-05 20:17:08 +0200
commit758d816b23e86cbe9f24471988e73f3c15f8c080 (patch)
treee412d580b11c652163aa67e046fad5504f4e4ac6
parenteb1578e7c8ca52d8de3222ebab16b352b670de4e (diff)
downloadserenity-758d816b23e86cbe9f24471988e73f3c15f8c080.zip
LibWeb: Clear SVG context after SVGSVGBox children are painted
-rw-r--r--Userland/Libraries/LibWeb/Layout/SVGSVGBox.cpp1
-rw-r--r--Userland/Libraries/LibWeb/Painting/PaintContext.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/SVGSVGBox.cpp b/Userland/Libraries/LibWeb/Layout/SVGSVGBox.cpp
index bbbd9a6137..f53bbbbebe 100644
--- a/Userland/Libraries/LibWeb/Layout/SVGSVGBox.cpp
+++ b/Userland/Libraries/LibWeb/Layout/SVGSVGBox.cpp
@@ -37,6 +37,7 @@ void SVGSVGBox::after_children_paint(PaintContext& context, PaintPhase phase)
SVGGraphicsBox::after_children_paint(context, phase);
if (phase != PaintPhase::Foreground)
return;
+ context.clear_svg_context();
}
}
diff --git a/Userland/Libraries/LibWeb/Painting/PaintContext.h b/Userland/Libraries/LibWeb/Painting/PaintContext.h
index 6ae814994d..682601c158 100644
--- a/Userland/Libraries/LibWeb/Painting/PaintContext.h
+++ b/Userland/Libraries/LibWeb/Painting/PaintContext.h
@@ -29,6 +29,7 @@ public:
bool has_svg_context() const { return m_svg_context.has_value(); }
SVGContext& svg_context() { return m_svg_context.value(); }
void set_svg_context(SVGContext context) { m_svg_context = context; }
+ void clear_svg_context() { m_svg_context.clear(); }
bool should_show_line_box_borders() const { return m_should_show_line_box_borders; }
void set_should_show_line_box_borders(bool value) { m_should_show_line_box_borders = value; }