1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-23 10:47:36 +00:00

LibWeb: Remove ValueListStyleValue :^)

This was the whole point of this PR. No more dealing with
ComponentValues in StyleResolver!
This commit is contained in:
Sam Atkins 2021-08-12 12:11:59 +01:00 committed by Andreas Kling
parent 678760bd87
commit afc434c416
4 changed files with 2 additions and 42 deletions

View file

@ -2839,7 +2839,8 @@ RefPtr<StyleValue> Parser::parse_css_value(PropertyID property_id, TokenStream<S
if (component_values.size() == 1) if (component_values.size() == 1)
return parse_css_value(m_context, property_id, component_values.first()); return parse_css_value(m_context, property_id, component_values.first());
return ValueListStyleValue::create(move(component_values)); dbgln("Unable to parse value for CSS '{}' property.", string_from_property_id(property_id));
return {};
} }
RefPtr<StyleValue> Parser::parse_css_value(ParsingContext const& context, PropertyID property_id, StyleComponentValueRule const& component_value) RefPtr<StyleValue> Parser::parse_css_value(ParsingContext const& context, PropertyID property_id, StyleComponentValueRule const& component_value)

View file

@ -542,11 +542,6 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope
return; 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); style.set_property(property_id, value);
} }

View file

@ -172,23 +172,4 @@ void ImageStyleValue::resource_did_load()
m_document->browsing_context()->set_needs_display({}); m_document->browsing_context()->set_needs_display({});
} }
ValueListStyleValue::ValueListStyleValue(Vector<StyleComponentValueRule>&& 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();
}
} }

View file

@ -227,7 +227,6 @@ public:
CustomProperty, CustomProperty,
Numeric, Numeric,
ValueList, ValueList,
ComponentValueList,
Calculated, Calculated,
Background, Background,
BackgroundRepeat, BackgroundRepeat,
@ -254,7 +253,6 @@ public:
bool is_custom_property() const { return type() == Type::CustomProperty; } bool is_custom_property() const { return type() == Type::CustomProperty; }
bool is_numeric() const { return type() == Type::Numeric; } bool is_numeric() const { return type() == Type::Numeric; }
bool is_value_list() const { return type() == Type::ValueList; } 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_calculated() const { return type() == Type::Calculated; }
bool is_background() const { return type() == Type::Background; } bool is_background() const { return type() == Type::Background; }
bool is_background_repeat() const { return type() == Type::BackgroundRepeat; } bool is_background_repeat() const { return type() == Type::BackgroundRepeat; }
@ -1020,21 +1018,6 @@ private:
NonnullRefPtrVector<StyleValue> m_values; NonnullRefPtrVector<StyleValue> m_values;
}; };
class ValueListStyleValue final : public StyleValue {
public:
static NonnullRefPtr<ValueListStyleValue> create(Vector<StyleComponentValueRule>&& values) { return adopt_ref(*new ValueListStyleValue(move(values))); }
virtual ~ValueListStyleValue() override { }
virtual String to_string() const override;
Vector<StyleComponentValueRule> const& values() const { return m_values; }
private:
ValueListStyleValue(Vector<StyleComponentValueRule>&&);
Vector<StyleComponentValueRule> m_values;
};
inline CSS::ValueID StyleValue::to_identifier() const inline CSS::ValueID StyleValue::to_identifier() const
{ {
if (is_identifier()) if (is_identifier())