LibWeb: Allow floating point values when parsing SVG viewboxes

This commit is contained in:
MacDue 2023-04-10 12:38:24 +01:00 committed by Andreas Kling
parent f753a4f640
commit ba7383d28f
Notes: sideshowbarker 2024-07-17 18:46:57 +09:00

View file

@ -30,7 +30,7 @@ Optional<ViewBox> try_parse_view_box(StringView string)
while (!lexer.is_eof()) {
lexer.consume_while([](auto ch) { return is_ascii_space(ch); });
auto token = lexer.consume_until([](auto ch) { return is_ascii_space(ch) && ch != ','; });
auto maybe_number = token.to_int();
auto maybe_number = token.to_float();
if (!maybe_number.has_value())
return {};
switch (state) {