LibWeb: Always include shadow roots in DOM debug dumps

This commit is contained in:
Andreas Kling 2023-03-08 15:09:16 +01:00
parent d517e7fb3a
commit 9eb8025463
Notes: sideshowbarker 2024-07-17 00:23:42 +09:00

View File

@ -63,8 +63,10 @@ void dump_tree(StringBuilder& builder, DOM::Node const& node)
builder.appendff("{}\n", node.node_name());
}
++indent;
if (is<DOM::Element>(node) && verify_cast<DOM::Element>(node).shadow_root()) {
dump_tree(builder, *verify_cast<DOM::Element>(node).shadow_root());
if (is<DOM::Element>(node)) {
if (auto* shadow_root = static_cast<DOM::Element const&>(node).shadow_root_internal()) {
dump_tree(builder, *shadow_root);
}
}
if (is<DOM::ParentNode>(node)) {
if (!is<HTML::HTMLTemplateElement>(node)) {