1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:47:35 +00:00

LibWeb: Implement the :defined pseudo class

This selects an element if it is either a built-in element, or an
upgraded custom element.
This commit is contained in:
Luke Wilde 2023-03-29 23:48:40 +01:00 committed by Andreas Kling
parent 6ebdb9f824
commit a744ae79ff
5 changed files with 11 additions and 0 deletions

View file

@ -228,6 +228,7 @@ ErrorOr<String> Selector::SimpleSelector::serialize() const
case Selector::SimpleSelector::PseudoClass::Type::Checked:
case Selector::SimpleSelector::PseudoClass::Type::Active:
case Selector::SimpleSelector::PseudoClass::Type::Scope:
case Selector::SimpleSelector::PseudoClass::Type::Defined:
// 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)));