summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Layout
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2023-03-26 09:50:24 +0200
committerAndreas Kling <kling@serenityos.org>2023-03-26 15:14:35 +0200
commit3932afdc6abb63ade23b84e54edd3b39397c8d39 (patch)
tree74080fb64cd08a2c0733979f4cdc0e671262fc8d /Userland/Libraries/LibWeb/Layout
parentd38392d416bce72b15a242a6482811fb7bd24e38 (diff)
downloadserenity-3932afdc6abb63ade23b84e54edd3b39397c8d39.zip
LibWeb: Remove unnecessary repeat of partial flex layout algorithm
When calculating one of the intrinsic sizes for a flex container, we already go through the flex layout algorithm. There's no need to perform some of the algorithm steps a second time. This is a relic from an earlier time when we tried to bail early from the layout algorithm in the intrinsic sizing case. Now that we go through the whole thing anyway, this is much simpler. :^)
Diffstat (limited to 'Userland/Libraries/LibWeb/Layout')
-rw-r--r--Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp10
1 files changed, 0 insertions, 10 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp
index 3ccbd1213f..7333fedcf2 100644
--- a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp
+++ b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp
@@ -1758,16 +1758,6 @@ CSSPixels FlexFormattingContext::calculate_intrinsic_cross_size_of_flex_containe
// NOTE: We fall through to the ad-hoc section below.
}
- // HACK: We run steps 5, 7, 9 and 11 from the main algorithm. This gives us *some* cross size information to work with.
- m_flex_lines.clear();
- collect_flex_items_into_flex_lines();
-
- for (auto& item : m_flex_items) {
- determine_hypothetical_cross_size_of_item(item, false);
- }
- calculate_cross_size_of_each_flex_line();
- determine_used_cross_size_of_each_flex_item();
-
CSSPixels sum_of_flex_line_cross_sizes = 0;
for (auto& flex_line : m_flex_lines) {
sum_of_flex_line_cross_sizes += flex_line.cross_size;