diff options
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/Selector.h | 6 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/Element.h | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/Dump.cpp | 3 |
3 files changed, 9 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/Selector.h b/Userland/Libraries/LibWeb/CSS/Selector.h index 81f65191f5..7f8ab37af0 100644 --- a/Userland/Libraries/LibWeb/CSS/Selector.h +++ b/Userland/Libraries/LibWeb/CSS/Selector.h @@ -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(); } diff --git a/Userland/Libraries/LibWeb/DOM/Element.h b/Userland/Libraries/LibWeb/DOM/Element.h index e54e89de5a..93c91cf6d6 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.h +++ b/Userland/Libraries/LibWeb/DOM/Element.h @@ -206,7 +206,7 @@ private: Vector<FlyString> m_classes; - Array<JS::GCPtr<Layout::Node>, CSS::Selector::PseudoElementCount> m_pseudo_element_nodes; + Array<JS::GCPtr<Layout::Node>, to_underlying(CSS::Selector::PseudoElement::PseudoElementCount)> m_pseudo_element_nodes; }; template<> diff --git a/Userland/Libraries/LibWeb/Dump.cpp b/Userland/Libraries/LibWeb/Dump.cpp index 08d4e6fb6d..4bd99992dc 100644 --- a/Userland/Libraries/LibWeb/Dump.cpp +++ b/Userland/Libraries/LibWeb/Dump.cpp @@ -508,6 +508,9 @@ void dump_selector(StringBuilder& builder, CSS::Selector const& selector) case CSS::Selector::PseudoElement::Placeholder: pseudo_element_description = "placeholder"; break; + case CSS::Selector::PseudoElement::PseudoElementCount: + VERIFY_NOT_REACHED(); + break; } builder.appendff(" pseudo_element={}", pseudo_element_description); |