Bug 1622221 - Rework number input localization. r=jwatt

This restores our previous behavior with the new <input type=number>
implementation (see the changes in test_input_number_l10n.html, which undoes the
changes of the regressing bug), and adds a test that shows that we display the
localized value properly.

Differential Revision: https://phabricator.services.mozilla.com/D66822
This commit is contained in:
Emilio Cobos Álvarez
2020-03-23 09:36:52 +00:00
parent b60473da1a
commit c2425f96ba
9 changed files with 63 additions and 12 deletions

View File

@@ -1085,12 +1085,14 @@ class HTMLInputElement final : public TextControlElement,
MOZ_CAN_RUN_SCRIPT
void HandleTypeChange(uint8_t aNewType, bool aNotify);
enum class ForValueGetter { No, Yes };
/**
* Sanitize the value of the element depending of its current type.
* See:
* http://www.whatwg.org/specs/web-apps/current-work/#value-sanitization-algorithm
*/
void SanitizeValue(nsAString& aValue);
void SanitizeValue(nsAString& aValue, ForValueGetter = ForValueGetter::No);
/**
* Returns whether the placeholder attribute applies for the current type.