1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:27:45 +00:00

LibWeb: Don't clip to containing block when painting abspos descendants

This commit is contained in:
Andreas Kling 2022-09-13 20:45:38 +02:00
parent f941b7aefe
commit 63c727a4a3
10 changed files with 37 additions and 25 deletions

View file

@ -257,11 +257,14 @@ BorderRadiiData PaintableBox::normalized_border_radii_data(ShrinkRadiiForBorders
return border_radius_data;
}
void PaintableBox::before_children_paint(PaintContext& context, PaintPhase phase) const
void PaintableBox::before_children_paint(PaintContext& context, PaintPhase phase, ShouldClipOverflow should_clip_overflow) const
{
if (!AK::first_is_one_of(phase, PaintPhase::Background, PaintPhase::Border, PaintPhase::Foreground))
return;
if (should_clip_overflow == ShouldClipOverflow::No)
return;
// FIXME: Support more overflow variations.
auto clip_rect = absolute_padding_box_rect().to_rounded<int>();
auto overflow_x = computed_values().overflow_x();
@ -293,11 +296,14 @@ void PaintableBox::before_children_paint(PaintContext& context, PaintPhase phase
}
}
void PaintableBox::after_children_paint(PaintContext& context, PaintPhase phase) const
void PaintableBox::after_children_paint(PaintContext& context, PaintPhase phase, ShouldClipOverflow should_clip_overflow) const
{
if (!AK::first_is_one_of(phase, PaintPhase::Background, PaintPhase::Border, PaintPhase::Foreground))
return;
if (should_clip_overflow == ShouldClipOverflow::No)
return;
// FIXME: Support more overflow variations.
if (m_clipping_overflow) {
context.painter().restore();