summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Layout
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-07-10 23:53:40 +0200
committerAndreas Kling <kling@serenityos.org>2022-07-11 18:57:45 +0200
commitaee3d79ad1853179ed35738a164ffa1f8ba47e6a (patch)
tree7b1b26e18c4f3b6b57bdc604e287fdafc25cc37d /Userland/Libraries/LibWeb/Layout
parentf7750985fa3c8efebd91574a5fe34859606a2103 (diff)
downloadserenity-aee3d79ad1853179ed35738a164ffa1f8ba47e6a.zip
LibWeb: Use the "scaled flex shrink factor" where noted by the spec
Diffstat (limited to 'Userland/Libraries/LibWeb/Layout')
-rw-r--r--Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp
index 1a3ec1078e..e67dc0dd71 100644
--- a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp
+++ b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp
@@ -732,7 +732,7 @@ void FlexFormattingContext::determine_main_size_of_flex_container(bool const mai
if (max_content_flex_fraction > 0) {
max_content_flex_fraction /= max(flex_item.box.computed_values().flex_grow(), 1.0f);
} else {
- max_content_flex_fraction /= max(flex_item.box.computed_values().flex_shrink(), 1.0f) * flex_item.flex_base_size;
+ max_content_flex_fraction /= flex_item.scaled_flex_shrink_factor;
}
flex_item.max_content_flex_fraction = max_content_flex_fraction;
@@ -748,7 +748,7 @@ void FlexFormattingContext::determine_main_size_of_flex_container(bool const mai
if (flex_item.max_content_flex_fraction > 0) {
product = largest_max_content_flex_fraction * flex_item.box.computed_values().flex_grow();
} else {
- product = largest_max_content_flex_fraction * max(flex_item.box.computed_values().flex_shrink(), 1.0f) * flex_item.flex_base_size;
+ product = largest_max_content_flex_fraction * flex_item.scaled_flex_shrink_factor;
}
result += flex_item.flex_base_size + flex_item.margins.main_before + flex_item.margins.main_after + flex_item.borders.main_before + flex_item.borders.main_after + flex_item.padding.main_before + flex_item.padding.main_after + product;
}
@@ -1355,7 +1355,7 @@ float FlexFormattingContext::calculate_intrinsic_main_size_of_flex_container(Lay
if (flex_fraction >= 0)
flex_fraction /= max(flex_item.box.computed_values().flex_grow(), 1.0f);
else
- flex_fraction /= max(flex_item.box.computed_values().flex_shrink(), 1.0f) * flex_item.flex_base_size;
+ flex_fraction /= flex_item.scaled_flex_shrink_factor;
// FIXME: The name max_content_flex_fraction here is misleading, since we also use this code path for min-content sizing.
flex_item.max_content_flex_fraction = flex_fraction;
@@ -1388,7 +1388,7 @@ float FlexFormattingContext::calculate_intrinsic_main_size_of_flex_container(Lay
if (flex_item->max_content_flex_fraction >= 0) {
product = largest_flex_fraction * flex_item->box.computed_values().flex_grow();
} else {
- product = largest_flex_fraction * max(flex_item->box.computed_values().flex_shrink(), 1.0f) * flex_item->flex_base_size;
+ product = largest_flex_fraction * flex_item->scaled_flex_shrink_factor;
}
sum += flex_item->flex_base_size + flex_item->margins.main_before + flex_item->margins.main_after + flex_item->borders.main_before + flex_item->borders.main_after + flex_item->padding.main_before + flex_item->padding.main_after + product;
}