1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-28 12:32:06 +00:00

LibWeb: Implement the :is() selector

This lets us finally get rid of a FIXME in the default style sheet. :^)
This commit is contained in:
Sam Atkins 2022-03-17 15:28:42 +00:00 committed by Andreas Kling
parent 88d218721b
commit c148ed50bb
6 changed files with 37 additions and 21 deletions

View file

@ -154,8 +154,14 @@ static inline bool matches_pseudo_class(CSS::Selector::SimpleSelector::PseudoCla
return true;
case CSS::Selector::SimpleSelector::PseudoClass::Type::Checked:
return matches_checked_pseudo_class(element);
case CSS::Selector::SimpleSelector::PseudoClass::Type::Is:
for (auto& selector : pseudo_class.argument_selector_list) {
if (matches(selector, element))
return true;
}
return false;
case CSS::Selector::SimpleSelector::PseudoClass::Type::Not:
for (auto& selector : pseudo_class.not_selector) {
for (auto& selector : pseudo_class.argument_selector_list) {
if (matches(selector, element))
return false;
}