mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 03:37:53 +00:00
LibHTML: Support the :only-child pseudo class
This commit is contained in:
@@ -36,6 +36,10 @@ bool matches(const Selector::SimpleSelector& component, const Element& element)
|
||||
if (element.next_element_sibling())
|
||||
return false;
|
||||
break;
|
||||
case Selector::SimpleSelector::PseudoClass::OnlyChild:
|
||||
if (element.previous_element_sibling() || element.next_element_sibling())
|
||||
return false;
|
||||
break;
|
||||
case Selector::SimpleSelector::PseudoClass::Empty:
|
||||
if (element.first_child_of_type<Element>() || element.first_child_of_type<Text>())
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user