mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 07:25:07 +00:00
LibHTML: Support the :first-child and :last-child pseudo classes
This commit is contained in:
parent
870df4a8c6
commit
c1474e594e
6 changed files with 63 additions and 0 deletions
|
@ -27,6 +27,14 @@ bool matches(const Selector::SimpleSelector& component, const Element& element)
|
|||
if (!matches_hover_pseudo_class(element))
|
||||
return false;
|
||||
break;
|
||||
case Selector::SimpleSelector::PseudoClass::FirstChild:
|
||||
if (element.previous_element_sibling())
|
||||
return false;
|
||||
break;
|
||||
case Selector::SimpleSelector::PseudoClass::LastChild:
|
||||
if (element.next_element_sibling())
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (component.attribute_match_type) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue