summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Wilde <lukew@serenityos.org>2022-06-10 14:45:06 +0100
committerLinus Groh <mail@linusgroh.de>2022-06-10 15:25:24 +0100
commit0ff66b6ed801e41267bf5c5cfba6de947bb2dcfb (patch)
treed85e6c86a2253c02ae3c47384ed59088354c35c6
parent1b135f9127d3534d2a307a5d934159c5cb4e6310 (diff)
downloadserenity-0ff66b6ed801e41267bf5c5cfba6de947bb2dcfb.zip
LibWeb/CSS: Add :nth-of-type and :nth-last-of-type serialisation
-rw-r--r--Userland/Libraries/LibWeb/CSS/Selector.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/Selector.cpp b/Userland/Libraries/LibWeb/CSS/Selector.cpp
index 832267748c..31e989109c 100644
--- a/Userland/Libraries/LibWeb/CSS/Selector.cpp
+++ b/Userland/Libraries/LibWeb/CSS/Selector.cpp
@@ -232,6 +232,8 @@ String Selector::SimpleSelector::serialize() const
break;
case Selector::SimpleSelector::PseudoClass::Type::NthChild:
case Selector::SimpleSelector::PseudoClass::Type::NthLastChild:
+ case Selector::SimpleSelector::PseudoClass::Type::NthOfType:
+ case Selector::SimpleSelector::PseudoClass::Type::NthLastOfType:
case Selector::SimpleSelector::PseudoClass::Type::Not:
case Selector::SimpleSelector::PseudoClass::Type::Is:
case Selector::SimpleSelector::PseudoClass::Type::Where:
@@ -241,7 +243,9 @@ String Selector::SimpleSelector::serialize() const
s.append(pseudo_class_name(pseudo_class.type));
s.append('(');
if (pseudo_class.type == Selector::SimpleSelector::PseudoClass::Type::NthChild
- || pseudo_class.type == Selector::SimpleSelector::PseudoClass::Type::NthLastChild) {
+ || pseudo_class.type == Selector::SimpleSelector::PseudoClass::Type::NthLastChild
+ || pseudo_class.type == Selector::SimpleSelector::PseudoClass::Type::NthOfType
+ || pseudo_class.type == Selector::SimpleSelector::PseudoClass::Type::NthLastOfType) {
// The result of serializing the value using the rules to serialize an <an+b> value.
s.append(pseudo_class.nth_child_pattern.serialize());
} else if (pseudo_class.type == Selector::SimpleSelector::PseudoClass::Type::Not