1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:17:46 +00:00

LibWeb: Ensure the number of pseudo elements stays up-to-date

The ::placeholder pseudo element was added in commit 1fbad9c, but the
total number of pseudo elements was not updated. Instead of this manual
bookkeeping, add a dummy value at the end of the enumeration for the
count.
This commit is contained in:
Timothy Flynn 2022-11-30 18:27:26 -05:00 committed by Tim Flynn
parent c21e9a415d
commit fddbc2e378
3 changed files with 9 additions and 2 deletions

View file

@ -29,8 +29,10 @@ public:
ProgressValue,
ProgressBar,
Placeholder,
// Keep this last.
PseudoElementCount,
};
static auto constexpr PseudoElementCount = to_underlying(PseudoElement::ProgressBar) + 1;
struct SimpleSelector {
enum class Type {
@ -227,6 +229,8 @@ constexpr StringView pseudo_element_name(Selector::PseudoElement pseudo_element)
return "-webkit-progress-value"sv;
case Selector::PseudoElement::Placeholder:
return "placeholder"sv;
case Selector::PseudoElement::PseudoElementCount:
break;
}
VERIFY_NOT_REACHED();
}