1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:47:45 +00:00

LibWeb: Use inner available space to calculate auto height of abspos

By using available_inner_space_or_constraints_from(available_space), we
ensure that the available space used to calculate the min/max content
height is constrained by the width specified for the box itself
(I know that at least GFC always expects available width to be
constrained by specified width if there is any).

This change improves layout in "Recent news" block on
https://telegram.org/
This commit is contained in:
Aliaksandr Kalenik 2023-11-14 17:33:45 +01:00 committed by Andreas Kling
parent 6b5a0100d9
commit eac7916d2c
3 changed files with 38 additions and 1 deletions

View file

@ -317,7 +317,7 @@ Optional<CSSPixels> FormattingContext::compute_auto_height_for_absolutely_positi
// NOTE: For anything else, we use the fit-content height.
// This should eventually be replaced by the new absolute positioning model:
// https://www.w3.org/TR/css-position-3/#abspos-layout
return calculate_fit_content_height(box, available_space);
return calculate_fit_content_height(box, m_state.get(box).available_inner_space_or_constraints_from(available_space));
}
// https://www.w3.org/TR/CSS22/visudet.html#root-height