LibWeb: Use preferred flex item sizes as min/max-content contribution

When a flex item has a specific preferred size, that size should be its
contribution to the containers intrinsic sizes.

This fixes an issue on Patreon where the logo would cover the entire
viewport since the SVG had a large intrinsic size but the flex item
containing it had a small specified size in CSS.
This commit is contained in:
Andreas Kling 2022-11-05 11:38:28 +01:00
commit 7809cc6557
Notes: sideshowbarker 2024-07-17 04:46:34 +09:00
3 changed files with 49 additions and 14 deletions

View file

@ -30,6 +30,9 @@ public:
virtual Gfx::FloatPoint calculate_static_position(Box const&) const override;
private:
[[nodiscard]] bool should_treat_main_size_as_auto(Box const&) const;
[[nodiscard]] bool should_treat_cross_size_as_auto(Box const&) const;
void dump_items() const;
struct DirectionAgnosticMargins {