1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 01:07:44 +00:00

LibWeb: Resolve % min-sizes against 0 while under min-content constraint

When resolving a percentage min-width or min-height size against a
containing block currently under a min-content constraint, we should act
as if the containing block has zero size in that axis.
This commit is contained in:
Andreas Kling 2023-06-16 13:46:55 +02:00
parent 1578121dcb
commit a988241f3f
7 changed files with 43 additions and 24 deletions

View file

@ -99,8 +99,8 @@ protected:
static bool should_treat_width_as_auto(Box const&, AvailableSpace const&);
static bool should_treat_height_as_auto(Box const&, AvailableSpace const&);
[[nodiscard]] bool should_treat_max_width_as_none(Box const&) const;
[[nodiscard]] bool should_treat_max_height_as_none(Box const&) const;
[[nodiscard]] bool should_treat_max_width_as_none(Box const&, AvailableSize const&) const;
[[nodiscard]] bool should_treat_max_height_as_none(Box const&, AvailableSize const&) const;
OwnPtr<FormattingContext> layout_inside(Box const&, LayoutMode, AvailableSpace const&);
void compute_inset(Box const& box);
@ -129,7 +129,7 @@ protected:
CSSPixels tentative_height_for_replaced_element(Box const&, CSS::Size const& computed_height, AvailableSpace const&) const;
CSSPixels compute_auto_height_for_block_formatting_context_root(Box const&) const;
[[nodiscard]] CSSPixelSize solve_replaced_size_constraint(CSSPixels input_width, CSSPixels input_height, Box const&) const;
[[nodiscard]] CSSPixelSize solve_replaced_size_constraint(CSSPixels input_width, CSSPixels input_height, Box const&, AvailableSpace const&) const;
ShrinkToFitResult calculate_shrink_to_fit_widths(Box const&);