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

LibWeb: Show DOM comment contents in DOM inspector

This commit is contained in:
Andreas Kling 2021-11-02 19:25:15 +01:00
parent 5db51d85a3
commit 5088846606
2 changed files with 5 additions and 0 deletions

View file

@ -714,6 +714,9 @@ void Node::serialize_tree_as_json(JsonObjectSerializer<StringBuilder>& object) c
auto text_node = static_cast<DOM::Text const*>(this);
object.add("text", text_node->data());
} else if (is_comment()) {
object.add("type"sv, "comment"sv);
object.add("data"sv, static_cast<DOM::Comment const&>(*this).data());
}
if (has_child_nodes()) {