LibWeb: Stop overflow clip box aggregation on reached stacking context

This commit is contained in:
Aliaksandr Kalenik 2023-02-24 01:17:00 +03:00 committed by Linus Groh
parent 87fa1c5e66
commit 6092d81e4d
Notes: sideshowbarker 2024-07-18 05:01:22 +09:00

View file

@ -317,8 +317,14 @@ BorderRadiiData PaintableBox::normalized_border_radii_data(ShrinkRadiiForBorders
Optional<CSSPixelRect> PaintableBox::clip_rect() const
{
if (!m_clip_rect.has_value()) {
if (containing_block() && containing_block()->paint_box())
// NOTE: stacking context should not be crossed while aggregating rectangle to
// clip `overflow: hidden` because intersecting rectangles with different
// transforms doesn't make sense
// TODO: figure out if there are cases when stacking context should be
// crossed to calculate correct clip rect
if (!stacking_context() && containing_block() && containing_block()->paint_box()) {
m_clip_rect = containing_block()->paint_box()->clip_rect();
}
auto overflow_x = computed_values().overflow_x();
auto overflow_y = computed_values().overflow_y();