Skip to content

Commit a086b75

Browse files
committed
LibWeb: Remove unnecessary parse_list_of_time_values function
We can achieve the same thing by using `parse_simple_comma_separated_value_list`
1 parent ceab6d3 commit a086b75

File tree

2 files changed

+2
-26
lines changed

2 files changed

+2
-26
lines changed

Libraries/LibWeb/CSS/Parser/Parser.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,8 +533,6 @@ class Parser {
533533
RefPtr<StyleValue const> parse_white_space_trim_value(TokenStream<ComponentValue>&);
534534
RefPtr<StyleValue const> parse_will_change_value(TokenStream<ComponentValue>&);
535535

536-
RefPtr<StyleValue const> parse_list_of_time_values(PropertyID, TokenStream<ComponentValue>&);
537-
538536
RefPtr<CalculationNode const> convert_to_calculation_node(CalcParsing::Node const&, CalculationContext const&);
539537
RefPtr<CalculationNode const> parse_a_calculation(Vector<ComponentValue> const&, CalculationContext const&);
540538

Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -734,11 +734,10 @@ Parser::ParseErrorOr<NonnullRefPtr<StyleValue const>> Parser::parse_css_value(Pr
734734
return parse_all_as(tokens, [this](auto& tokens) { return parse_transform_origin_value(tokens); });
735735
case PropertyID::Transition:
736736
return parse_all_as(tokens, [this](auto& tokens) { return parse_transition_value(tokens); });
737-
case PropertyID::TransitionDelay:
738-
case PropertyID::TransitionDuration:
739-
return parse_all_as(tokens, [this, property_id](auto& tokens) { return parse_list_of_time_values(property_id, tokens); });
740737
case PropertyID::TransitionProperty:
741738
return parse_all_as(tokens, [this](auto& tokens) { return parse_transition_property_value(tokens); });
739+
case PropertyID::TransitionDelay:
740+
case PropertyID::TransitionDuration:
742741
case PropertyID::TransitionTimingFunction:
743742
case PropertyID::TransitionBehavior:
744743
return parse_all_as(tokens, [this, property_id](auto& tokens) { return parse_simple_comma_separated_value_list(property_id, tokens); });
@@ -5051,27 +5050,6 @@ RefPtr<StyleValue const> Parser::parse_transition_value(TokenStream<ComponentVal
50515050
return parsed_value;
50525051
}
50535052

5054-
RefPtr<StyleValue const> Parser::parse_list_of_time_values(PropertyID property_id, TokenStream<ComponentValue>& tokens)
5055-
{
5056-
auto transaction = tokens.begin_transaction();
5057-
auto time_values = parse_a_comma_separated_list_of_component_values(tokens);
5058-
StyleValueVector time_value_list;
5059-
for (auto const& value : time_values) {
5060-
TokenStream time_value_tokens { value };
5061-
auto time_style_value = parse_time_value(time_value_tokens);
5062-
if (!time_style_value)
5063-
return nullptr;
5064-
if (time_value_tokens.has_next_token())
5065-
return nullptr;
5066-
if (!time_style_value->is_calculated() && !property_accepts_time(property_id, time_style_value->as_time().time()))
5067-
return nullptr;
5068-
time_value_list.append(*time_style_value);
5069-
}
5070-
5071-
transaction.commit();
5072-
return StyleValueList::create(move(time_value_list), StyleValueList::Separator::Comma);
5073-
}
5074-
50755053
RefPtr<StyleValue const> Parser::parse_transition_property_value(TokenStream<ComponentValue>& tokens)
50765054
{
50775055
// https://drafts.csswg.org/css-transitions/#transition-property-property

0 commit comments

Comments
 (0)