diff options
author | Andreas Kling <kling@serenityos.org> | 2021-09-12 12:58:17 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-12 16:07:35 +0200 |
commit | f58f58fb774d96d6fe1b1b9350bef233d4814967 (patch) | |
tree | ba6199171a5bc8ba62a7d3f850e505866ee9d962 /Userland/Libraries | |
parent | 678dd2d18031e8fabf91281af6e0776b269305d0 (diff) | |
download | serenity-f58f58fb774d96d6fe1b1b9350bef233d4814967.zip |
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.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibWeb/Dump.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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<DOM::Element>(node) && verify_cast<DOM::Element>(node).shadow_root()) { - dump_tree(*verify_cast<DOM::Element>(node).shadow_root()); + dump_tree(builder, *verify_cast<DOM::Element>(node).shadow_root()); } if (is<DOM::ParentNode>(node)) { if (!is<HTML::HTMLTemplateElement>(node)) { - static_cast<DOM::ParentNode const&>(node).for_each_child([](auto& child) { - dump_tree(child); + static_cast<DOM::ParentNode const&>(node).for_each_child([&](auto& child) { + dump_tree(builder, child); }); } else { auto& template_element = verify_cast<HTML::HTMLTemplateElement>(node); - dump_tree(template_element.content()); + dump_tree(builder, template_element.content()); } } --indent; |