LibWeb: Make apply_scroll_offset and reset_scroll_offset non-virtual

This commit is contained in:
Aliaksandr Kalenik 2025-07-07 18:39:05 +02:00 committed by Jelle Raaijmakers
commit c0526b085d
Notes: github-actions[bot] 2025-07-07 16:56:48 +00:00
5 changed files with 10 additions and 13 deletions

View file

@ -73,9 +73,6 @@ public:
virtual void paint(PaintContext&, PaintPhase) const { }
virtual void apply_scroll_offset(PaintContext&, PaintPhase) const { }
virtual void reset_scroll_offset(PaintContext&, PaintPhase) const { }
virtual void apply_clip_overflow_rect(PaintContext&, PaintPhase) const { }
virtual void clear_clip_overflow_rect(PaintContext&, PaintPhase) const { }

View file

@ -331,7 +331,7 @@ void PaintableBox::before_paint(PaintContext& context, PaintPhase phase) const
} else if (!has_css_transform()) {
apply_clip_overflow_rect(context, phase);
}
apply_scroll_offset(context, phase);
apply_scroll_offset(context);
}
void PaintableBox::after_paint(PaintContext& context, PaintPhase phase) const
@ -339,7 +339,7 @@ void PaintableBox::after_paint(PaintContext& context, PaintPhase phase) const
if (!is_visible())
return;
reset_scroll_offset(context, phase);
reset_scroll_offset(context);
if (first_is_one_of(phase, PaintPhase::Background, PaintPhase::Foreground) && own_clip_frame()) {
restore_clip(context, own_clip_frame());
} else if (!has_css_transform()) {
@ -619,14 +619,14 @@ BorderRadiiData PaintableBox::normalized_border_radii_data(ShrinkRadiiForBorders
return border_radii_data;
}
void PaintableBox::apply_scroll_offset(PaintContext& context, PaintPhase) const
void PaintableBox::apply_scroll_offset(PaintContext& context) const
{
if (scroll_frame_id().has_value()) {
context.display_list_recorder().push_scroll_frame_id(scroll_frame_id().value());
}
}
void PaintableBox::reset_scroll_offset(PaintContext& context, PaintPhase) const
void PaintableBox::reset_scroll_offset(PaintContext& context) const
{
if (scroll_frame_id().has_value()) {
context.display_list_recorder().pop_scroll_frame_id();

View file

@ -136,8 +136,8 @@ public:
virtual void set_needs_display(InvalidateDisplayList = InvalidateDisplayList::Yes) override;
virtual void apply_scroll_offset(PaintContext&, PaintPhase) const override;
virtual void reset_scroll_offset(PaintContext&, PaintPhase) const override;
void apply_scroll_offset(PaintContext&) const;
void reset_scroll_offset(PaintContext&) const;
virtual void apply_clip_overflow_rect(PaintContext&, PaintPhase) const override;
virtual void clear_clip_overflow_rect(PaintContext&, PaintPhase) const override;

View file

@ -24,14 +24,14 @@ void SVGPaintable::before_paint(PaintContext& context, PaintPhase phase) const
if (!has_css_transform()) {
apply_clip_overflow_rect(context, phase);
}
apply_scroll_offset(context, phase);
apply_scroll_offset(context);
}
void SVGPaintable::after_paint(PaintContext& context, PaintPhase phase) const
{
if (!is_visible())
return;
reset_scroll_offset(context, phase);
reset_scroll_offset(context);
if (!has_css_transform()) {
clear_clip_overflow_rect(context, phase);
}

View file

@ -31,14 +31,14 @@ void SVGSVGPaintable::before_paint(PaintContext& context, PaintPhase phase) cons
if (!has_css_transform()) {
apply_clip_overflow_rect(context, phase);
}
apply_scroll_offset(context, phase);
apply_scroll_offset(context);
}
void SVGSVGPaintable::after_paint(PaintContext& context, PaintPhase phase) const
{
if (!is_visible())
return;
reset_scroll_offset(context, phase);
reset_scroll_offset(context);
if (!has_css_transform()) {
clear_clip_overflow_rect(context, phase);
}