summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@gmail.com>2021-08-23 17:39:08 +0100
committerAndreas Kling <kling@serenityos.org>2021-09-02 22:16:41 +0200
commit1159eefff32b4053d7791b94eb1bea8ca447dd93 (patch)
treeb811f6bdbba0346692ed7c79bd37fe23fcda2eed /Userland
parent2d6a02f03bfa8f636826169178f0378b30f4b0b7 (diff)
downloadserenity-1159eefff32b4053d7791b94eb1bea8ca447dd93.zip
LibWeb: Include DOM Node ID in serialized JSON
This will be used in the DOM Inspector to communicate which node is being inspected.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/DOM/Node.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Node.cpp b/Userland/Libraries/LibWeb/DOM/Node.cpp
index 29c9647d59..1a7a05b793 100644
--- a/Userland/Libraries/LibWeb/DOM/Node.cpp
+++ b/Userland/Libraries/LibWeb/DOM/Node.cpp
@@ -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()) {