1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:17:44 +00:00

LibWeb: Display pseudo-elements in the DOM inspector

This patch only makes them appear in the tree - they are not yet
inspectable themselves.
This commit is contained in:
Sam Atkins 2022-03-03 17:50:12 +00:00 committed by Andreas Kling
parent 1c18bb13a2
commit 6de2b62906
5 changed files with 57 additions and 3 deletions

View file

@ -776,6 +776,13 @@ void Node::serialize_tree_as_json(JsonObjectSerializer<StringBuilder>& object) c
child.serialize_tree_as_json(child_object);
MUST(child_object.finish());
});
// Pseudo-elements don't have DOM nodes,so we have to add them separately.
if (is_element()) {
auto const* element = static_cast<DOM::Element const*>(this);
element->serialize_pseudo_elements_as_json(children);
}
MUST(children.finish());
}
}