Emilio Cobos Álvarez bf2d9b9d37 Bug 1842027 - Make <input type=number> localization faster. r=masayuki
Using the fast unlocalized parser first exposes a subtle difference
between the ICU parser (which uses `double`), and Decimal::fromString
(which has a larger range).

Check for iee754 finiteness explicitly, matching our previous behavior,
and the expectation of this subtest:

  https://searchfox.org/mozilla-central/rev/a3852ea8db25c759bc8b108aeec870d66c95452c/testing/web-platform/tests/html/semantics/forms/the-input-element/number.html#33

That check matches this Blink code:

  https://source.chromium.org/chromium/chromium/src/+/refs/heads/main:third_party/blink/renderer/core/html/parser/html_parser_idioms.cc;l=103;drc=0d1bbe8de137aaae7c956a33249eb840a0191627

This patch avoids a bunch of number->string->number conversions in the
common case where the value comes from the value attribute and thus
parses fine without localization shenanigans.

Differential Revision: https://phabricator.services.mozilla.com/D183254
2023-07-12 15:28:07 +00:00
..