mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
LibWeb: Correct logic when consuming a CSS number in scientific notation
Before, we were classifying the number as a "number" type if it had an "E", even if that was not followed by an exponent.
This commit is contained in:
parent
a8cd6c396b
commit
a3d6d9db37
Notes:
sideshowbarker
2024-07-17 03:05:16 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/a3d6d9db37 Pull-request: https://github.com/SerenityOS/serenity/pull/17989
@ -534,10 +534,11 @@ Number Tokenizer::consume_a_number()
|
||||
// U+0065 LATIN SMALL LETTER E (e), optionally followed by U+002D HYPHEN-MINUS (-)
|
||||
// or U+002B PLUS SIGN (+), followed by a digit, then:
|
||||
auto maybe_exp = peek_triplet();
|
||||
if (is_E(maybe_exp.first) || is_e(maybe_exp.first)) {
|
||||
if ((is_E(maybe_exp.first) || is_e(maybe_exp.first))
|
||||
&& (((is_plus_sign(maybe_exp.second) || is_hyphen_minus(maybe_exp.second)) && is_ascii_digit(maybe_exp.third))
|
||||
|| (is_ascii_digit(maybe_exp.second)))) {
|
||||
// 1. Consume them.
|
||||
// 2. Append them to repr.
|
||||
// FIXME: These conditions should be part of step 5 above.
|
||||
if (is_plus_sign(maybe_exp.second) || is_hyphen_minus(maybe_exp.second)) {
|
||||
if (is_ascii_digit(maybe_exp.third)) {
|
||||
repr.append_code_point(next_code_point());
|
||||
|
Loading…
Reference in New Issue
Block a user