summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-07-13 01:18:59 +0200
committerAndreas Kling <kling@serenityos.org>2022-07-13 01:26:29 +0200
commitd2b887a793397a7a22c7ba50e7f6cb704f809446 (patch)
tree6003118287d09cf52fb3c830132bdc66d9b84d85 /Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp
parenta1ddc44c079086704c42a37e11b632edb9645a74 (diff)
downloadserenity-d2b887a793397a7a22c7ba50e7f6cb704f809446.zip
LibWeb: Only create one wrapper for inline content inside flex container
Due to a missing `return` statement, we were creating two anonymous wrapper blocks around each piece of inline content inside a flex container. This had no visual impact, since they ended up with 0x0 dimensions, but we were wasting a fair bit of time running layout on them.
Diffstat (limited to 'Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp')
-rw-r--r--Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp b/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp
index c50b7ae971..46aab132fe 100644
--- a/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp
+++ b/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp
@@ -60,6 +60,7 @@ static Layout::Node& insertion_parent_for_inline_node(Layout::NodeWithStyle& lay
if (layout_parent.computed_values().display().is_flex_inside()) {
layout_parent.append_child(layout_parent.create_anonymous_wrapper());
+ return *layout_parent.last_child();
}
if (!has_in_flow_block_children(layout_parent) || layout_parent.children_are_inline())