diff --git a/Libraries/LibWeb/Layout/LayoutNode.cpp b/Libraries/LibWeb/Layout/LayoutNode.cpp index c44e886d8f..3bd10abeea 100644 --- a/Libraries/LibWeb/Layout/LayoutNode.cpp +++ b/Libraries/LibWeb/Layout/LayoutNode.cpp @@ -95,11 +95,15 @@ void LayoutNode::paint(PaintContext& context, PaintPhase phase) if (!is_visible()) return; + before_children_paint(context, phase); + for_each_child([&](auto& child) { if (child.is_box() && downcast(child).stacking_context()) return; child.paint(context, phase); }); + + after_children_paint(context, phase); } HitTestResult LayoutNode::hit_test(const Gfx::IntPoint& position, HitTestType type) const diff --git a/Libraries/LibWeb/Layout/LayoutNode.h b/Libraries/LibWeb/Layout/LayoutNode.h index 066e485f83..1b72b5645b 100644 --- a/Libraries/LibWeb/Layout/LayoutNode.h +++ b/Libraries/LibWeb/Layout/LayoutNode.h @@ -122,7 +122,10 @@ public: FocusOutline, Overlay, }; + + virtual void before_children_paint(PaintContext&, PaintPhase) {}; virtual void paint(PaintContext&, PaintPhase); + virtual void after_children_paint(PaintContext&, PaintPhase) {}; bool is_floating() const; bool is_absolutely_positioned() const;