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

LibWeb: Get reference height from closest non-anonymous ancestor

Ignore anonymous block boxes when resolving percentage weights that
would refer to them, per the CSS 2 visual formatting model
specification. This fixes the case when we create an anonymous block
between an image which uses a percentage height relative to a parent
which specifies a definite height.

Fixes #19052.
This commit is contained in:
Andi Gallo 2023-05-24 06:57:38 +00:00 committed by Andreas Kling
parent 706a20c4d4
commit 5cec517153
5 changed files with 79 additions and 3 deletions

View file

@ -112,6 +112,12 @@ public:
Box const* containing_block() const;
Box* containing_block() { return const_cast<Box*>(const_cast<Node const*>(this)->containing_block()); }
// Closest non-anonymous ancestor box, to be used when resolving percentage values.
// Anonymous block boxes are ignored when resolving percentage values that would refer to it:
// the closest non-anonymous ancestor box is used instead.
// https://www.w3.org/TR/CSS22/visuren.html#anonymous-block-level
Box const* non_anyonymous_containing_block() const;
bool establishes_stacking_context() const;
bool can_contain_boxes_with_position_absolute() const;