1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:17:34 +00:00

LibWeb: Fix clip of hidden overflow when translated boxes are involved

There is a problem with current approach where overflow clip rectange is
calculated by aggregating intersection of absolute padding boxes of
boxes in containing block chain that resulting rectangle doesn't
respect transform properties.

To solve this problem `PaintableBox` is changed to store clip rectangle
saved from painter because it does respect transform properties of all
previously applied clip rectangles.
This commit is contained in:
Aliaksandr Kalenik 2023-01-25 02:57:50 +03:00 committed by Andreas Kling
parent b0846ec78a
commit ee4ba7617c
3 changed files with 18 additions and 24 deletions

View file

@ -98,7 +98,7 @@ public:
return m_overflow_data->scrollable_overflow_rect;
}
Optional<CSSPixelRect> clip_rect() const;
Optional<Gfx::IntRect> clip_rect() const;
void set_overflow_data(Optional<OverflowData> data) { m_overflow_data = move(data); }
void set_containing_line_box_fragment(Optional<Layout::LineBoxFragmentCoordinate>);
@ -157,7 +157,7 @@ private:
Optional<CSSPixelRect> mutable m_absolute_rect;
Optional<CSSPixelRect> mutable m_absolute_paint_rect;
Optional<CSSPixelRect> mutable m_clip_rect;
Gfx::IntRect mutable m_clip_rect;
mutable bool m_clipping_overflow { false };
Optional<BorderRadiusCornerClipper> mutable m_overflow_corner_radius_clipper;