mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
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:
parent
9738070676
commit
173daec9db
Notes:
github-actions[bot]
2024-08-07 14:15:42 +00:00
Author: https://github.com/AtkinsSJ
Commit: 173daec9db
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/994
3 changed files with 17 additions and 4 deletions
|
@ -1141,6 +1141,17 @@ JS::GCPtr<Layout::NodeWithStyle> Element::get_pseudo_element_node(CSS::Selector:
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
bool Element::has_pseudo_elements() const
|
||||
{
|
||||
if (m_pseudo_element_data) {
|
||||
for (auto& pseudo_element : *m_pseudo_element_data) {
|
||||
if (pseudo_element.layout_node)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Element::clear_pseudo_element_nodes(Badge<Layout::TreeBuilder>)
|
||||
{
|
||||
if (m_pseudo_element_data) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue