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

LibWeb: Rename PaintableBox::clip_rect()

This commit is contained in:
Aliaksandr Kalenik 2023-03-19 20:28:30 +03:00 committed by Andreas Kling
parent 7ddacef3b5
commit dcc4868a3c
2 changed files with 4 additions and 4 deletions

View file

@ -314,7 +314,7 @@ BorderRadiiData PaintableBox::normalized_border_radii_data(ShrinkRadiiForBorders
return border_radius_data; return border_radius_data;
} }
Optional<CSSPixelRect> PaintableBox::clip_rect() const Optional<CSSPixelRect> PaintableBox::calculate_overflow_clipped_rect() const
{ {
if (!m_clip_rect.has_value()) { if (!m_clip_rect.has_value()) {
// NOTE: stacking context should not be crossed while aggregating rectangle to // NOTE: stacking context should not be crossed while aggregating rectangle to
@ -323,7 +323,7 @@ Optional<CSSPixelRect> PaintableBox::clip_rect() const
// TODO: figure out if there are cases when stacking context should be // TODO: figure out if there are cases when stacking context should be
// crossed to calculate correct clip rect // crossed to calculate correct clip rect
if (!stacking_context() && containing_block() && containing_block()->paint_box()) { if (!stacking_context() && containing_block() && containing_block()->paint_box()) {
m_clip_rect = containing_block()->paint_box()->clip_rect(); m_clip_rect = containing_block()->paint_box()->calculate_overflow_clipped_rect();
} }
auto overflow_x = computed_values().overflow_x(); auto overflow_x = computed_values().overflow_x();
@ -347,7 +347,7 @@ void PaintableBox::apply_clip_overflow_rect(PaintContext& context, PaintPhase ph
return; return;
// FIXME: Support more overflow variations. // FIXME: Support more overflow variations.
auto clip_rect = this->clip_rect(); auto clip_rect = this->calculate_overflow_clipped_rect();
auto overflow_x = computed_values().overflow_x(); auto overflow_x = computed_values().overflow_x();
auto overflow_y = computed_values().overflow_y(); auto overflow_y = computed_values().overflow_y();

View file

@ -98,7 +98,7 @@ public:
return m_overflow_data->scrollable_overflow_rect; return m_overflow_data->scrollable_overflow_rect;
} }
Optional<CSSPixelRect> clip_rect() const; Optional<CSSPixelRect> calculate_overflow_clipped_rect() const;
void set_overflow_data(Optional<OverflowData> data) { m_overflow_data = move(data); } void set_overflow_data(Optional<OverflowData> data) { m_overflow_data = move(data); }
void set_containing_line_box_fragment(Optional<Layout::LineBoxFragmentCoordinate>); void set_containing_line_box_fragment(Optional<Layout::LineBoxFragmentCoordinate>);