LibWeb/CSS: Make :heading() pseudo-class take integers not AN+B

Corresponds to 8eb3787e34
This commit is contained in:
Sam Atkins 2025-08-28 10:29:57 +01:00 committed by Jelle Raaijmakers
commit d461e96f40
Notes: github-actions[bot] 2025-08-28 10:41:31 +00:00
10 changed files with 79 additions and 161 deletions

View file

@ -435,7 +435,7 @@ String Selector::SimpleSelector::serialize() const
// For pseudo-classes with both a function and identifier form, see if they have arguments.
switch (pseudo_class.type) {
case PseudoClass::Heading:
return !pseudo_class.an_plus_b_patterns.is_empty();
return !pseudo_class.levels.is_empty();
case PseudoClass::Host:
return !pseudo_class.argument_selector_list.is_empty();
default:
@ -484,6 +484,10 @@ String Selector::SimpleSelector::serialize() const
// The serialization of a comma-separated list of each arguments serialization as a string, preserving relative order.
s.join(", "sv, pseudo_class.languages);
break;
case PseudoClassMetadata::ParameterType::LevelList:
// AD-HOC: not in the spec.
s.join(", "sv, pseudo_class.levels);
break;
}
s.append(')');
}