LibWeb: Implement the :target selector pseudo-class

We don't yet set the Document's target element in most cases, so this
does not function very well. But that will improve once we *do* set it,
which involves a more complete Navigables implementation.
This commit is contained in:
Sam Atkins 2023-08-11 20:07:00 +01:00 committed by Andreas Kling
parent 8bd3b74e3a
commit a9620d8784
Notes: sideshowbarker 2024-07-17 07:25:39 +09:00
5 changed files with 11 additions and 0 deletions

View file

@ -425,6 +425,8 @@ static inline bool matches_pseudo_class(CSS::Selector::SimpleSelector::PseudoCla
auto const& media_element = static_cast<HTML::HTMLMediaElement const&>(element);
return media_element.stalled();
}
case CSS::Selector::SimpleSelector::PseudoClass::Type::Target:
return element.is_target();
}
return false;