mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-05 01:10:24 +00:00
LibWeb: Simplify compute_style_value_list
This commit is contained in:
Notes:
github-actions[bot]
2025-12-02 12:48:16 +00:00
Author: https://github.com/Calme1709 Commit: https://github.com/LadybirdBrowser/ladybird/commit/e935dfbf5b7 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6997 Reviewed-by: https://github.com/AtkinsSJ ✅
@@ -2820,18 +2820,12 @@ static CSSPixels snap_a_length_as_a_border_width(double device_pixels_per_css_pi
|
|||||||
|
|
||||||
static NonnullRefPtr<StyleValue const> compute_style_value_list(NonnullRefPtr<StyleValue const> const& style_value, Function<NonnullRefPtr<StyleValue const>(NonnullRefPtr<StyleValue const> const&)> const& compute_entry)
|
static NonnullRefPtr<StyleValue const> compute_style_value_list(NonnullRefPtr<StyleValue const> const& style_value, Function<NonnullRefPtr<StyleValue const>(NonnullRefPtr<StyleValue const> const&)> const& compute_entry)
|
||||||
{
|
{
|
||||||
// FIXME: This is required because our animation-* properties are not yet parsed as lists.
|
StyleValueVector computed_entries;
|
||||||
// Once that is fixed, every value here will be a StyleValueList.
|
|
||||||
if (style_value->is_value_list()) {
|
|
||||||
StyleValueVector computed_entries;
|
|
||||||
|
|
||||||
for (auto const& entry : style_value->as_value_list().values())
|
for (auto const& entry : style_value->as_value_list().values())
|
||||||
computed_entries.append(compute_entry(entry));
|
computed_entries.append(compute_entry(entry));
|
||||||
|
|
||||||
return StyleValueList::create(move(computed_entries), StyleValueList::Separator::Comma);
|
return StyleValueList::create(move(computed_entries), StyleValueList::Separator::Comma);
|
||||||
}
|
|
||||||
|
|
||||||
return compute_entry(style_value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NonnullRefPtr<StyleValue const> StyleComputer::compute_value_of_property(
|
NonnullRefPtr<StyleValue const> StyleComputer::compute_value_of_property(
|
||||||
|
|||||||
Reference in New Issue
Block a user