summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-11-05 11:38:28 +0100
committerAndreas Kling <kling@serenityos.org>2022-11-05 11:42:19 +0100
commit7809cc65579c52a2b3f69548bac86489ef4d2a0b (patch)
tree3f750ca34274ac04aed8ddb91dc92ec03b6cf1c7 /Userland/Libraries/LibWeb/Layout/FlexFormattingContext.h
parentea7ce76d208c283d46b0645b823c7f742f712e90 (diff)
downloadserenity-7809cc65579c52a2b3f69548bac86489ef4d2a0b.zip
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.
Diffstat (limited to 'Userland/Libraries/LibWeb/Layout/FlexFormattingContext.h')
-rw-r--r--Userland/Libraries/LibWeb/Layout/FlexFormattingContext.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.h b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.h
index 0fc842817e..fa06620131 100644
--- a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.h
+++ b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.h
@@ -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 {