diff --git a/Libraries/LibWeb/Painting/Paintable.h b/Libraries/LibWeb/Painting/Paintable.h index 50ea317c5cb..3fec6eb7bf2 100644 --- a/Libraries/LibWeb/Painting/Paintable.h +++ b/Libraries/LibWeb/Painting/Paintable.h @@ -73,9 +73,6 @@ public: virtual void paint(PaintContext&, PaintPhase) const { } - virtual void before_children_paint(PaintContext&, PaintPhase) const { } - virtual void after_children_paint(PaintContext&, PaintPhase) const { } - virtual void apply_scroll_offset(PaintContext&, PaintPhase) const { } virtual void reset_scroll_offset(PaintContext&, PaintPhase) const { } diff --git a/Libraries/LibWeb/Painting/SVGSVGPaintable.cpp b/Libraries/LibWeb/Painting/SVGSVGPaintable.cpp index 61cf5806d6a..c1d42f8a19d 100644 --- a/Libraries/LibWeb/Painting/SVGSVGPaintable.cpp +++ b/Libraries/LibWeb/Painting/SVGSVGPaintable.cpp @@ -29,22 +29,6 @@ Layout::SVGSVGBox const& SVGSVGPaintable::layout_box() const return static_cast(layout_node()); } -void SVGSVGPaintable::before_children_paint(PaintContext& context, PaintPhase phase) const -{ - PaintableBox::before_children_paint(context, phase); - if (phase != PaintPhase::Foreground) - return; - context.display_list_recorder().push_scroll_frame_id(scroll_frame_id()); -} - -void SVGSVGPaintable::after_children_paint(PaintContext& context, PaintPhase phase) const -{ - PaintableBox::after_children_paint(context, phase); - if (phase != PaintPhase::Foreground) - return; - context.display_list_recorder().pop_scroll_frame_id(); -} - static Gfx::FloatMatrix4x4 matrix_with_scaled_translation(Gfx::FloatMatrix4x4 matrix, float scale) { auto* m = matrix.elements(); @@ -132,12 +116,10 @@ void SVGSVGPaintable::paint_descendants(PaintContext& context, PaintableBox cons if (phase != PaintPhase::Foreground) return; - paintable.before_children_paint(context, PaintPhase::Foreground); paintable.for_each_child_of_type([&](PaintableBox& child) { paint_svg_box(context, child, phase); return IterationDecision::Continue; }); - paintable.after_children_paint(context, PaintPhase::Foreground); } } diff --git a/Libraries/LibWeb/Painting/SVGSVGPaintable.h b/Libraries/LibWeb/Painting/SVGSVGPaintable.h index c21a3ac7eff..7a37c971d86 100644 --- a/Libraries/LibWeb/Painting/SVGSVGPaintable.h +++ b/Libraries/LibWeb/Painting/SVGSVGPaintable.h @@ -18,9 +18,6 @@ class SVGSVGPaintable final : public PaintableBox { public: static GC::Ref create(Layout::SVGSVGBox const&); - virtual void before_children_paint(PaintContext&, PaintPhase) const override; - virtual void after_children_paint(PaintContext&, PaintPhase) const override; - Layout::SVGSVGBox const& layout_box() const; static void paint_svg_box(PaintContext& context, PaintableBox const& svg_box, PaintPhase phase); diff --git a/Libraries/LibWeb/Painting/StackingContext.cpp b/Libraries/LibWeb/Painting/StackingContext.cpp index 60db19762b5..8021840fd0b 100644 --- a/Libraries/LibWeb/Painting/StackingContext.cpp +++ b/Libraries/LibWeb/Painting/StackingContext.cpp @@ -116,8 +116,6 @@ void StackingContext::paint_svg(PaintContext& context, PaintableBox const& paint void StackingContext::paint_descendants(PaintContext& context, Paintable const& paintable, StackingContextPaintPhase phase) { - paintable.before_children_paint(context, to_paint_phase(phase)); - paintable.for_each_child([&context, phase](auto& child) { if (child.layout_node().is_svg_svg_box()) { paint_svg(context, static_cast(child), to_paint_phase(phase)); @@ -195,8 +193,6 @@ void StackingContext::paint_descendants(PaintContext& context, Paintable const& return IterationDecision::Continue; }); - - paintable.after_children_paint(context, to_paint_phase(phase)); } void StackingContext::paint_child(PaintContext& context, StackingContext const& child) @@ -206,14 +202,7 @@ void StackingContext::paint_child(PaintContext& context, StackingContext const& const_cast(child).set_last_paint_generation_id(context.paint_generation_id()); - auto parent_paintable = child.paintable_box().parent(); - if (parent_paintable) - parent_paintable->before_children_paint(context, PaintPhase::Foreground); - child.paint(context); - - if (parent_paintable) - parent_paintable->after_children_paint(context, PaintPhase::Foreground); } void StackingContext::paint_internal(PaintContext& context) const @@ -255,16 +244,11 @@ void StackingContext::paint_internal(PaintContext& context) const for (auto const& paintable : m_positioned_descendants_and_stacking_contexts_with_stack_level_0) { // At this point, `paintable_box` is a positioned descendant with z-index: auto. // FIXME: This is basically duplicating logic found elsewhere in this same function. Find a way to make this more elegant. - auto* parent_paintable = paintable->parent(); - if (parent_paintable) - parent_paintable->before_children_paint(context, PaintPhase::Foreground); if (auto* child = paintable->stacking_context()) { paint_child(context, *child); } else { paint_node_as_stacking_context(paintable, context); } - if (parent_paintable) - parent_paintable->after_children_paint(context, PaintPhase::Foreground); }; // Stacking contexts formed by positioned descendants with z-indices greater than or equal to 1 in z-index order