1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:27:35 +00:00

LibWeb: Include shadow DOM subtrees in DOM dumps

This commit is contained in:
Andreas Kling 2021-02-10 18:25:05 +01:00
parent e562819a7e
commit e4e325ff61

View file

@ -31,8 +31,8 @@
#include <LibWeb/CSS/StyleSheet.h>
#include <LibWeb/DOM/Comment.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/DocumentFragment.h>
#include <LibWeb/DOM/Element.h>
#include <LibWeb/DOM/ShadowRoot.h>
#include <LibWeb/DOM/Text.h>
#include <LibWeb/Dump.h>
#include <LibWeb/HTML/HTMLTemplateElement.h>
@ -60,6 +60,9 @@ void dump_tree(const DOM::Node& node)
dbgprintf("%s\n", node.node_name().characters());
}
++indent;
if (is<DOM::Element>(node) && downcast<DOM::Element>(node).shadow_root()) {
dump_tree(*downcast<DOM::Element>(node).shadow_root());
}
if (is<DOM::ParentNode>(node)) {
if (!is<HTML::HTMLTemplateElement>(node)) {
static_cast<const DOM::ParentNode&>(node).for_each_child([](auto& child) {