From afc434c416dbf546b2aa7e672370138e7e9b57b2 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Thu, 12 Aug 2021 12:11:59 +0100 Subject: LibWeb: Remove ValueListStyleValue :^) This was the whole point of this PR. No more dealing with ComponentValues in StyleResolver! --- Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp | 3 ++- Userland/Libraries/LibWeb/CSS/StyleResolver.cpp | 5 ----- Userland/Libraries/LibWeb/CSS/StyleValue.cpp | 19 ------------------- Userland/Libraries/LibWeb/CSS/StyleValue.h | 17 ----------------- 4 files changed, 2 insertions(+), 42 deletions(-) (limited to 'Userland/Libraries/LibWeb') diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index 454d00cb9e..d663630326 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -2839,7 +2839,8 @@ RefPtr Parser::parse_css_value(PropertyID property_id, TokenStream Parser::parse_css_value(ParsingContext const& context, PropertyID property_id, StyleComponentValueRule const& component_value) diff --git a/Userland/Libraries/LibWeb/CSS/StyleResolver.cpp b/Userland/Libraries/LibWeb/CSS/StyleResolver.cpp index 8cef749945..7a5f9124f9 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleResolver.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleResolver.cpp @@ -542,11 +542,6 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope return; } - if (value.is_component_value_list()) { - dbgln("Values list for CSS property '{}' went unhandled. List: '{}'", string_from_property_id(property_id), value.to_string()); - return; - } - style.set_property(property_id, value); } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValue.cpp index f7300c5dee..1e6a676b37 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValue.cpp @@ -172,23 +172,4 @@ void ImageStyleValue::resource_did_load() m_document->browsing_context()->set_needs_display({}); } -ValueListStyleValue::ValueListStyleValue(Vector&& values) - : StyleValue(Type::ComponentValueList) - , m_values(move(values)) -{ -} - -String ValueListStyleValue::to_string() const -{ - StringBuilder builder; - builder.appendff("List[{}](", m_values.size()); - for (auto& value : m_values) { - builder.append(value.to_debug_string()); - builder.append(","); - } - - builder.append(")"); - return builder.to_string(); -} - } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValue.h index 17697b815c..e294b8988e 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValue.h @@ -227,7 +227,6 @@ public: CustomProperty, Numeric, ValueList, - ComponentValueList, Calculated, Background, BackgroundRepeat, @@ -254,7 +253,6 @@ public: bool is_custom_property() const { return type() == Type::CustomProperty; } bool is_numeric() const { return type() == Type::Numeric; } bool is_value_list() const { return type() == Type::ValueList; } - bool is_component_value_list() const { return type() == Type::ComponentValueList; } bool is_calculated() const { return type() == Type::Calculated; } bool is_background() const { return type() == Type::Background; } bool is_background_repeat() const { return type() == Type::BackgroundRepeat; } @@ -1020,21 +1018,6 @@ private: NonnullRefPtrVector m_values; }; -class ValueListStyleValue final : public StyleValue { -public: - static NonnullRefPtr create(Vector&& values) { return adopt_ref(*new ValueListStyleValue(move(values))); } - virtual ~ValueListStyleValue() override { } - - virtual String to_string() const override; - - Vector const& values() const { return m_values; } - -private: - ValueListStyleValue(Vector&&); - - Vector m_values; -}; - inline CSS::ValueID StyleValue::to_identifier() const { if (is_identifier()) -- cgit v1.2.3