at (150.3125,12) content-size 136.3125x48 flex-item children: inline
+ line 0 width: 136.3125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 15, rect: [150.3125,12 136.3125x17.46875]
+ "LongPieceOfText"
+ TextNode <#text>
+ BlockContainer
at (288.625,12) content-size 136.3125x48 flex-item children: inline
+ line 0 width: 136.3125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 15, rect: [288.625,12 136.3125x17.46875]
+ "LongPieceOfText"
+ TextNode <#text>
+ BlockContainer
at (426.9375,12) content-size 136.3125x48 flex-item children: inline
+ line 0 width: 136.3125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 15, rect: [426.9375,12 136.3125x17.46875]
+ "LongPieceOfText"
+ TextNode <#text>
+ BlockContainer
at (565.25,12) content-size 222.75x48 flex-item children: inline
+ line 0 width: 136.3125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 15, rect: [565.25,12 136.3125x17.46875]
+ "LongPieceOfText"
+ TextNode <#text>
diff --git a/Tests/LibWeb/Layout/input/flex-frozen-items-should-be-respected.html b/Tests/LibWeb/Layout/input/flex-frozen-items-should-be-respected.html
new file mode 100644
index 0000000000..10f5b7ca77
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/flex-frozen-items-should-be-respected.html
@@ -0,0 +1,13 @@
+LongPieceOfText
LongPieceOfText
LongPieceOfText
LongPieceOfText
LongPieceOfText
\ No newline at end of file
diff --git a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp
index b2726039fa..d2d5e3fd08 100644
--- a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp
+++ b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp
@@ -972,10 +972,14 @@ void FlexFormattingContext::resolve_flexible_lengths_for_line(FlexLine& line)
else if (used_flex_factor == FlexFactor::FlexShrinkFactor) {
// For every unfrozen item on the line, multiply its flex shrink factor by its inner flex base size, and note this as its scaled flex shrink factor.
for (auto& item : line.items) {
+ if (item.frozen)
+ continue;
item.scaled_flex_shrink_factor = item.flex_factor.value() * item.flex_base_size.value();
}
auto sum_of_scaled_flex_shrink_factors_of_all_unfrozen_items_on_line = line.sum_of_scaled_flex_shrink_factor_of_unfrozen_items();
for (auto& item : line.items) {
+ if (item.frozen)
+ continue;
// Find the ratio of the item’s scaled flex shrink factor to the sum of the scaled flex shrink factors of all unfrozen items on the line.
float ratio = 1.0f;
if (sum_of_scaled_flex_shrink_factors_of_all_unfrozen_items_on_line != 0)