mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Tokenize CSS numbers as doubles
Every later stage uses doubles, so dropping that precision right at the start of parsing is a little silly. :^)
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 06:40:35 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/1a5533e528 Pull-request: https://github.com/SerenityOS/serenity/pull/20678
@@ -574,11 +574,11 @@ Number Tokenizer::consume_a_number()
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/css-syntax-3/#convert-string-to-number
|
||||
float Tokenizer::convert_a_string_to_a_number(StringView string)
|
||||
double Tokenizer::convert_a_string_to_a_number(StringView string)
|
||||
{
|
||||
// FIXME: We already found the whole part, fraction part and exponent during
|
||||
// validation, we could probably skip
|
||||
return string.to_float(AK::TrimWhitespace::No).release_value();
|
||||
return string.to_double(AK::TrimWhitespace::No).release_value();
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/css-syntax-3/#consume-name
|
||||
|
||||
Reference in New Issue
Block a user