LibWeb: Show pseudo-elements in DOM whose parent has no other children

If a DOM node is an element with pseudo-elements, but it has no child
DOM nodes and is not a shadow host, then the code that serializes its
pseudo-elements would get skipped, making them not show up in the
inspector.
This commit is contained in:
Sam Atkins 2024-08-06 14:28:36 +01:00 committed by Andreas Kling
commit 173daec9db
Notes: github-actions[bot] 2024-08-07 14:15:42 +00:00
3 changed files with 17 additions and 4 deletions

View file

@ -245,6 +245,7 @@ public:
void set_pseudo_element_node(Badge<Layout::TreeBuilder>, CSS::Selector::PseudoElement::Type, JS::GCPtr<Layout::NodeWithStyle>);
JS::GCPtr<Layout::NodeWithStyle> get_pseudo_element_node(CSS::Selector::PseudoElement::Type) const;
bool has_pseudo_elements() const;
void clear_pseudo_element_nodes(Badge<Layout::TreeBuilder>);
void serialize_pseudo_elements_as_json(JsonArraySerializer<StringBuilder>& children_array) const;