Skip to content

Commit b52beb5

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 e8ba1b4 commit b52beb5

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

Libraries/LibWeb/CSS/ComputedProperties.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -378,19 +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 only required until we update parse_comma_separated_list to always return a StyleValueList
383-
auto const get_property_value_as_list = [&](PropertyID property_id) {
384-
auto const& value = property(property_id);
385-
386-
return value.is_value_list() ? value.as_value_list().values() : StyleValueVector { value };
387-
};
388-
389381
HashMap<PropertyID, StyleValueVector> coordinated_value_list;
390382

391-
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++) {
392384
for (auto property_id : property_ids) {
393-
auto const& list = get_property_value_as_list(property_id);
385+
auto const& list = property(property_id).as_value_list().values();
394386

395387
coordinated_value_list.ensure(property_id).append(list[i % list.size()]);
396388
}

0 commit comments

Comments
 (0)