diff options
author | Luke Wilde <lukew@serenityos.org> | 2022-11-05 15:17:33 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-11-07 14:10:41 +0100 |
commit | 1fbad9caaf07401e3206cd8c355721952bdbfbce (patch) | |
tree | 00e7641e9f8d82764d4c5f99a0e7503d7f42e347 /Userland | |
parent | dfad2d4c13d62d5221f8792ec7ca14a2378a0b17 (diff) | |
download | serenity-1fbad9caaf07401e3206cd8c355721952bdbfbce.zip |
LibWeb: Recognise the ::placeholder pseudo element
This doesn't give it any functionality.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/Selector.cpp | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/Selector.h | 5 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/Dump.cpp | 3 |
3 files changed, 9 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/Selector.cpp b/Userland/Libraries/LibWeb/CSS/Selector.cpp index ca10a764ef..02e3656a30 100644 --- a/Userland/Libraries/LibWeb/CSS/Selector.cpp +++ b/Userland/Libraries/LibWeb/CSS/Selector.cpp @@ -356,6 +356,8 @@ Optional<Selector::PseudoElement> pseudo_element_from_string(StringView name) return Selector::PseudoElement::ProgressBar; } else if (name.equals_ignoring_case("-webkit-progress-value"sv)) { return Selector::PseudoElement::ProgressValue; + } else if (name.equals_ignoring_case("placeholder"sv)) { + return Selector::PseudoElement::Placeholder; } return {}; } diff --git a/Userland/Libraries/LibWeb/CSS/Selector.h b/Userland/Libraries/LibWeb/CSS/Selector.h index 14ebcdadca..81f65191f5 100644 --- a/Userland/Libraries/LibWeb/CSS/Selector.h +++ b/Userland/Libraries/LibWeb/CSS/Selector.h @@ -27,7 +27,8 @@ public: FirstLetter, Marker, ProgressValue, - ProgressBar + ProgressBar, + Placeholder, }; static auto constexpr PseudoElementCount = to_underlying(PseudoElement::ProgressBar) + 1; @@ -224,6 +225,8 @@ constexpr StringView pseudo_element_name(Selector::PseudoElement pseudo_element) return "-webkit-progress-bar"sv; case Selector::PseudoElement::ProgressValue: return "-webkit-progress-value"sv; + case Selector::PseudoElement::Placeholder: + return "placeholder"sv; } VERIFY_NOT_REACHED(); } diff --git a/Userland/Libraries/LibWeb/Dump.cpp b/Userland/Libraries/LibWeb/Dump.cpp index 87820759cb..08d4e6fb6d 100644 --- a/Userland/Libraries/LibWeb/Dump.cpp +++ b/Userland/Libraries/LibWeb/Dump.cpp @@ -505,6 +505,9 @@ void dump_selector(StringBuilder& builder, CSS::Selector const& selector) case CSS::Selector::PseudoElement::ProgressValue: pseudo_element_description = "-webkit-progress-value"; break; + case CSS::Selector::PseudoElement::Placeholder: + pseudo_element_description = "placeholder"; + break; } builder.appendff(" pseudo_element={}", pseudo_element_description); |