From bdf2323b3f8dc3711b9ebb6951006381cc6578db Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Tue, 5 Sep 2023 15:17:10 -0400 Subject: [PATCH] LibWeb: Perform layout of a slot's assigned nodes --- Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp b/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp index cd76a95bab..56ce152697 100644 --- a/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp +++ b/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -342,6 +343,19 @@ ErrorOr TreeBuilder::create_layout_tree(DOM::Node& dom_node, TreeBuilder:: layout_node->append_child(*list_item_marker); } + if (is(dom_node)) { + auto slottables = static_cast(dom_node).assigned_nodes_internal(); + push_parent(verify_cast(*layout_node)); + + for (auto const& slottable : slottables) { + TRY(slottable.visit([&](auto& node) -> ErrorOr { + return create_layout_tree(node, context); + })); + } + + pop_parent(); + } + if (is(dom_node)) { auto& progress = static_cast(dom_node); if (!progress.using_system_appearance()) {