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

LibWeb: Parse the -webkit-progress-bar/value pseudo elements

These will be needed for styling progress bars, sadly this can
only be done with these non-standard selectors. These are, hovever,
in use on real sites such as https://rpcs3.net/compatibility.
This commit is contained in:
MacDue 2022-07-22 15:58:52 +01:00 committed by Andreas Kling
parent 218e6d2f5e
commit b5febe538c
4 changed files with 21 additions and 3 deletions

View file

@ -26,8 +26,10 @@ public:
FirstLine,
FirstLetter,
Marker,
ProgressValue,
ProgressBar
};
static auto constexpr PseudoElementCount = to_underlying(PseudoElement::Marker) + 1;
static auto constexpr PseudoElementCount = to_underlying(PseudoElement::ProgressBar) + 1;
struct SimpleSelector {
enum class Type {
@ -204,6 +206,10 @@ constexpr StringView pseudo_element_name(Selector::PseudoElement pseudo_element)
return "first-letter"sv;
case Selector::PseudoElement::Marker:
return "marker"sv;
case Selector::PseudoElement::ProgressBar:
return "-webkit-progress-bar"sv;
case Selector::PseudoElement::ProgressValue:
return "-webkit-progress-value"sv;
}
VERIFY_NOT_REACHED();
}