LibHTML: Support the :first-child and :last-child pseudo classes

This commit is contained in:
Andreas Kling 2019-12-16 19:34:52 +01:00
commit c1474e594e
Notes: sideshowbarker 2024-07-19 10:50:13 +09:00
6 changed files with 63 additions and 0 deletions

View file

@ -321,6 +321,10 @@ public:
simple_selector.pseudo_class = Selector::SimpleSelector::PseudoClass::Link;
else if (pseudo_name == "hover")
simple_selector.pseudo_class = Selector::SimpleSelector::PseudoClass::Hover;
else if (pseudo_name == "first-child")
simple_selector.pseudo_class = Selector::SimpleSelector::PseudoClass::FirstChild;
else if (pseudo_name == "last-child")
simple_selector.pseudo_class = Selector::SimpleSelector::PseudoClass::LastChild;
}
return simple_selector;