From 5dfe99e247728d09ddd3537afd121ab63b076343 Mon Sep 17 00:00:00 2001 From: Matthew Olsson Date: Tue, 5 Mar 2024 18:15:52 -0700 Subject: [PATCH] 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". --- Userland/Libraries/LibWeb/CSS/StyleComputer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp index aa6827f2d0..aa4789c85a 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -818,13 +818,13 @@ static RefPtr 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()) {