diff options
author | Andreas Kling <kling@serenityos.org> | 2022-02-17 22:43:22 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-02-18 01:49:32 +0100 |
commit | 7c33a084fb6e8e751173b6c959c30533b3f02f23 (patch) | |
tree | e5e70482a2a9d383e02b1e443f6806cdd0e47d24 /Userland/Libraries/LibWeb/CSS/Selector.cpp | |
parent | b9b24cb1c1c73fbcbdc9bec6b9b2bf8e47efa4a6 (diff) | |
download | serenity-7c33a084fb6e8e751173b6c959c30533b3f02f23.zip |
LibWeb: Support CSS :only-of-type selector
This matches any element that doesn't have a sibling with the same tag
name as itself.
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS/Selector.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/Selector.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/Selector.cpp b/Userland/Libraries/LibWeb/CSS/Selector.cpp index d88c18b186..6b9e27d2f9 100644 --- a/Userland/Libraries/LibWeb/CSS/Selector.cpp +++ b/Userland/Libraries/LibWeb/CSS/Selector.cpp @@ -135,6 +135,7 @@ String Selector::SimpleSelector::serialize() const case Selector::SimpleSelector::PseudoClass::Type::Root: case Selector::SimpleSelector::PseudoClass::Type::FirstOfType: case Selector::SimpleSelector::PseudoClass::Type::LastOfType: + case Selector::SimpleSelector::PseudoClass::Type::OnlyOfType: case Selector::SimpleSelector::PseudoClass::Type::Disabled: case Selector::SimpleSelector::PseudoClass::Type::Enabled: case Selector::SimpleSelector::PseudoClass::Type::Checked: @@ -281,6 +282,8 @@ constexpr StringView pseudo_class_name(Selector::SimpleSelector::PseudoClass::Ty return "first-of-type"sv; case Selector::SimpleSelector::PseudoClass::Type::LastOfType: return "last-of-type"sv; + case Selector::SimpleSelector::PseudoClass::Type::OnlyOfType: + return "only-of-type"sv; case Selector::SimpleSelector::PseudoClass::Type::Disabled: return "disabled"sv; case Selector::SimpleSelector::PseudoClass::Type::Enabled: |