1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:58:11 +00:00

LibWeb: Include DOM Node ID in serialized JSON

This will be used in the DOM Inspector to communicate which node is
being inspected.
This commit is contained in:
Sam Atkins 2021-08-23 17:39:08 +01:00 committed by Andreas Kling
parent 2d6a02f03b
commit 1159eefff3

View file

@ -640,6 +640,7 @@ RefPtr<Document> Node::owner_document() const
void Node::serialize_tree_as_json(JsonObjectSerializer<StringBuilder>& object) const
{
object.add("name", node_name().view());
object.add("id", id());
if (is_document()) {
object.add("type", "document");
} else if (is_element()) {