mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:57:44 +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:
parent
706a20c4d4
commit
5cec517153
5 changed files with 79 additions and 3 deletions
|
@ -114,6 +114,17 @@ Box const* Node::containing_block() const
|
|||
return nearest_ancestor_capable_of_forming_a_containing_block(*this);
|
||||
}
|
||||
|
||||
Box const* Node::non_anyonymous_containing_block() const
|
||||
{
|
||||
auto nearest_ancestor_box = containing_block();
|
||||
VERIFY(nearest_ancestor_box);
|
||||
while (nearest_ancestor_box->is_anonymous()) {
|
||||
nearest_ancestor_box = nearest_ancestor_box->containing_block();
|
||||
VERIFY(nearest_ancestor_box);
|
||||
}
|
||||
return nearest_ancestor_box;
|
||||
}
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context
|
||||
bool Node::establishes_stacking_context() const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue