Skip to content

Commit 38efc39

Browse files
Calme1709AtkinsSJ
authored andcommitted
LibWeb: Simplify assemble_coordinated_value_list
We know that all coordinated value list longhands are parsed as `StyleValueList`s
1 parent 74e6c50 commit 38efc39

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

Libraries/LibWeb/CSS/ComputedProperties.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -378,20 +378,11 @@ HashMap<PropertyID, StyleValueVector> ComputedProperties::assemble_coordinated_v
378378
// - If a coordinating list property has too few values specified, its value list is repeated to add more used
379379
// values.
380380
// - The computed values of the coordinating list properties are not affected by such truncation or repetition.
381-
382-
// FIXME: This is required because our animation-* properties are not yet parsed as lists.
383-
// Once that is fixed, every value here will be a StyleValueList.
384-
auto const get_property_value_as_list = [&](PropertyID property_id) {
385-
auto const& value = property(property_id);
386-
387-
return value.is_value_list() ? value.as_value_list().values() : StyleValueVector { value };
388-
};
389-
390381
HashMap<PropertyID, StyleValueVector> coordinated_value_list;
391382

392-
for (size_t i = 0; i < get_property_value_as_list(base_property_id).size(); i++) {
383+
for (size_t i = 0; i < property(base_property_id).as_value_list().size(); i++) {
393384
for (auto property_id : property_ids) {
394-
auto const& list = get_property_value_as_list(property_id);
385+
auto const& list = property(property_id).as_value_list().values();
395386

396387
coordinated_value_list.ensure(property_id).append(list[i % list.size()]);
397388
}

0 commit comments

Comments
 (0)