diff --git a/Userland/Libraries/LibWeb/CSS/Selector.cpp b/Userland/Libraries/LibWeb/CSS/Selector.cpp index 02e3656a30..dff7ce49a9 100644 --- a/Userland/Libraries/LibWeb/CSS/Selector.cpp +++ b/Userland/Libraries/LibWeb/CSS/Selector.cpp @@ -238,6 +238,7 @@ String Selector::SimpleSelector::serialize() const case Selector::SimpleSelector::PseudoClass::Type::Not: case Selector::SimpleSelector::PseudoClass::Type::Is: case Selector::SimpleSelector::PseudoClass::Type::Where: + case Selector::SimpleSelector::PseudoClass::Type::Lang: // Otherwise, append ":" (U+003A), followed by the name of the pseudo-class, followed by "(" (U+0028), // followed by the value of the pseudo-class argument(s) determined as per below, followed by ")" (U+0029), to s. s.append(':'); @@ -255,10 +256,14 @@ String Selector::SimpleSelector::serialize() const // The result of serializing the value using the rules for serializing a group of selectors. // NOTE: `:is()` and `:where()` aren't in the spec for this yet, but it should be! s.append(serialize_a_group_of_selectors(pseudo_class.argument_selector_list)); + } else if (pseudo_class.type == Selector::SimpleSelector::PseudoClass::Type::Lang) { + // The serialization of a comma-separated list of each argument’s serialization as a string, preserving relative order. + s.join(", "sv, pseudo_class.languages); } s.append(')'); break; default: + dbgln("FIXME: Unknown pseudo class type for serialization: {}", to_underlying(pseudo_class.type)); VERIFY_NOT_REACHED(); } break;