From f58f58fb774d96d6fe1b1b9350bef233d4814967 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 12 Sep 2021 12:58:17 +0200 Subject: LibWeb: Fix out-of-order DOM tree dumps There were a few calls to the standalone version of dump_tree() inside the recursive version of dump_tree(), which led to the output getting jumbled out of order. --- Userland/Libraries/LibWeb/Dump.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Userland') diff --git a/Userland/Libraries/LibWeb/Dump.cpp b/Userland/Libraries/LibWeb/Dump.cpp index 4322129ed1..6990dd2327 100644 --- a/Userland/Libraries/LibWeb/Dump.cpp +++ b/Userland/Libraries/LibWeb/Dump.cpp @@ -52,16 +52,16 @@ void dump_tree(StringBuilder& builder, DOM::Node const& node) } ++indent; if (is(node) && verify_cast(node).shadow_root()) { - dump_tree(*verify_cast(node).shadow_root()); + dump_tree(builder, *verify_cast(node).shadow_root()); } if (is(node)) { if (!is(node)) { - static_cast(node).for_each_child([](auto& child) { - dump_tree(child); + static_cast(node).for_each_child([&](auto& child) { + dump_tree(builder, child); }); } else { auto& template_element = verify_cast(node); - dump_tree(template_element.content()); + dump_tree(builder, template_element.content()); } } --indent; -- cgit v1.2.3