mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 15:47:42 +00:00
LibWeb: Allow floating point values when parsing SVG viewboxes
This commit is contained in:
parent
f753a4f640
commit
ba7383d28f
1 changed files with 1 additions and 1 deletions
|
@ -30,7 +30,7 @@ Optional<ViewBox> try_parse_view_box(StringView string)
|
||||||
while (!lexer.is_eof()) {
|
while (!lexer.is_eof()) {
|
||||||
lexer.consume_while([](auto ch) { return is_ascii_space(ch); });
|
lexer.consume_while([](auto ch) { return is_ascii_space(ch); });
|
||||||
auto token = lexer.consume_until([](auto ch) { return is_ascii_space(ch) && 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())
|
if (!maybe_number.has_value())
|
||||||
return {};
|
return {};
|
||||||
switch (state) {
|
switch (state) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue