1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:17:45 +00:00

LibWeb: Implement the :playing and :paused pseudo-classes

These match media elements (`<video>` and `<audio>`) which are playing
or paused, respectively.
This commit is contained in:
Sam Atkins 2023-08-01 12:31:41 +01:00 committed by Tim Flynn
parent a336fe4fc4
commit 4df5e24926
6 changed files with 34 additions and 1 deletions

View file

@ -231,6 +231,8 @@ ErrorOr<String> Selector::SimpleSelector::serialize() const
case Selector::SimpleSelector::PseudoClass::Type::Active:
case Selector::SimpleSelector::PseudoClass::Type::Scope:
case Selector::SimpleSelector::PseudoClass::Type::Defined:
case Selector::SimpleSelector::PseudoClass::Type::Playing:
case Selector::SimpleSelector::PseudoClass::Type::Paused:
// If the pseudo-class does not accept arguments append ":" (U+003A), followed by the name of the pseudo-class, to s.
TRY(s.try_append(':'));
TRY(s.try_append(pseudo_class_name(pseudo_class.type)));