LibWeb: Disallow ASF in DOMMatrix constructor

We have no context to resolve ASFs against here so we should throw.
This commit is contained in:
Callum Law 2025-09-27 01:30:53 +12:00 committed by Alexander Kalenik
parent bf1564388d
commit 99dd648475
Notes: github-actions[bot] 2025-09-28 15:44:19 +00:00
3 changed files with 16 additions and 1 deletions

View file

@ -950,7 +950,7 @@ WebIDL::ExceptionOr<ParsedMatrix> parse_dom_matrix_init_string(JS::Realm& realm,
// The result will be a <transform-list>, the keyword none, or failure.
// If parsedValue is failure, or any <transform-function> has <length> values without absolute length units, or any keyword other than none is used, then return failure. [CSS3-SYNTAX] [CSS3-TRANSFORMS]
auto transform_style_value = parse_css_value(CSS::Parser::ParsingParams {}, transform_list, CSS::PropertyID::Transform);
if (!transform_style_value || (transform_style_value->is_keyword() && transform_style_value->to_keyword() != CSS::Keyword::None))
if (!transform_style_value || (transform_style_value->is_keyword() && transform_style_value->to_keyword() != CSS::Keyword::None) || transform_style_value->is_unresolved())
return WebIDL::SyntaxError::create(realm, "Failed to parse CSS transform string."_utf16);
auto parsed_value = CSS::ComputedProperties::transformations_for_style_value(*transform_style_value);