LibWeb: Do not assert the type of transformation style values

In this case, the StyleValue may be "unresolved", however let's just
avoid the assert altogether and treat all non-transform values as
"none".
This commit is contained in:
Matthew Olsson 2024-03-05 18:15:52 -07:00 committed by Andreas Kling
parent 1ca31e0dc1
commit 5dfe99e247
Notes: sideshowbarker 2024-07-16 19:42:24 +09:00

View file

@ -818,13 +818,13 @@ static RefPtr<StyleValue const> interpolate_transform(DOM::Element& element, Sty
};
static constexpr auto style_value_to_matrix = [](DOM::Element& element, StyleValue const& value) -> FloatMatrix4x4 {
if (value.to_identifier() == ValueID::None)
return FloatMatrix4x4::identity();
if (value.is_transformation())
return transformation_style_value_to_matrix(element, value.as_transformation()).value_or(FloatMatrix4x4::identity());
VERIFY(value.is_value_list());
// This encompasses both the allowed value "none" and any invalid values
if (!value.is_value_list())
return FloatMatrix4x4::identity();
auto matrix = FloatMatrix4x4::identity();
for (auto const& value_element : value.as_value_list().values()) {
if (value_element->is_transformation()) {