Closed Bug 1622221 Opened 5 years ago Closed 5 years ago

Wrong decimal separator in number-fields

Categories

(Core :: Layout: Form Controls, defect, P2)

74 Branch
defect

Tracking

()

VERIFIED FIXED
mozilla76
Tracking Status
firefox-esr68 --- unaffected
firefox74 --- wontfix
firefox75 + verified
firefox76 --- verified

People

(Reporter: gabriel, Assigned: emilio)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: intl, regression)

Attachments

(2 files, 1 obsolete file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.5 Safari/605.1.15

Steps to reproduce:

On all older versions of Firefox (and other Browsers) this code:
<input type="number" step="0.1" value="10.7" />
results in a text fild with the value "10,7" (not the comma) on systems where commas are used as decimal separator (like german systems).

But now in version 74, the first code results in a field with the value "10.7" which is not formatted correctly with the system settings.

Component: Untriaged → Layout: Form Controls
Keywords: intl
Product: Firefox → Core

Hmm, so I think this is a misunderstanding of mine when looking at the interop state of this from bug 981248, I think.

In Gecko, before that change, data:text/html,<input type="number" step="0.1" value="10.7" lang="de"> would show the comma, but not in other browsers. So I aligned Firefox with the other browsers.

But it seems other browsers may have been following the lang of the browser installation, instead of the lang specified by the page, ugh...

We clearly need to do something about this, I'll take a look.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(emilio)
Priority: -- → P2
Regressed by: 981248
Has Regression Range: --- → yes

Safari and Chrome shows the comma correcty (browser and System are set to German).

(In reply to Gabriel Gritsch from comment #2)

Safari and Chrome shows the comma correcty (browser and System are set to German).

Right, but that's the key difference. On an English build (like the ones I was testing with) they wouldn't show the comma for the lang=de example.

This is what confused me.

Yes but Firefox does NOT show the command on a German System with German Firefox and lang="de".
I had to downgrade all Firefox installations to FF ESR (with --allow-downgrade) - I hop this change/bug does not find its way to the ESR.

command -> comma

Sure, I agree, thus the "we need to do something about this" :)

Thanks for reporting the bug.

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.

Assignee: nobody → emilio
Status: NEW → ASSIGNED
Flags: needinfo?(emilio)
Flags: needinfo?(emilio)
Flags: needinfo?(emilio)
Blocks: 1621627

[Tracking Requested - why for this release]: Regression in 74 with a fair amount of duplicates, which would be nice to not ship in 75.

Blocks: 1622808
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/07fc10be600e Rework number input localization. r=jwatt

Comment on attachment 9133286 [details]
Bug 1622221 - Rework number input localization. r=jwatt

Beta/Release Uplift Approval Request

  • User impact if declined: comment 0 and dupes
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: see comment 0, and all the duplicates
  • List of other uplifts needed: None
  • Risk to taking this patch: Medium
  • Why is the change risky/not risky? (and alternatives if risky): I don't think it's too risky, and the patch is relatively straight-forward, but it's definitely non-trivial code.

The patch is very self-contained to the localized-input-number case, though, so I think it's ok to uplift. Alternative is to keep shipping our current behavior for one more release, but given the amount of dupes that's probably not fine.

  • String changes made/needed: none
Attachment #9133286 - Flags: approval-mozilla-beta?
Flags: qe-verify+
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76
QA Whiteboard: [qa-triaged]
Flags: in-testsuite+

Comment on attachment 9133286 [details]
Bug 1622221 - Rework number input localization. r=jwatt

fix for regression in 74 with many dupes, let's risk it for 75.0b8

Attachment #9133286 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Reproduced with the testcase from comment 0 and the duplicates using Firefox 75 beta 7 under Win 10 64-bit.
Verified as fixed on latest Nightly 76.0a1 2020-03-23 under Win 10 64-bit, Ubuntu 18 and Mac OS X 10.14.

This is the only diff:

diff --git a/dom/html/input/NumericInputTypes.h b/dom/html/input/NumericInputTypes.h
index fa31f7a36e8b..9b53c3c02f86 100644
--- a/dom/html/input/NumericInputTypes.h
+++ b/dom/html/input/NumericInputTypes.h
@@ -44,7 +44,7 @@ class NumberInputType final : public NumericInputTypeBase {
   nsresult GetValueMissingMessage(nsAString& aMessage) override;
   nsresult GetBadInputMessage(nsAString& aMessage) override;
 
-  bool ConvertNumberToString(Decimal aValue,
+  bool ConvertNumberToString(mozilla::Decimal aValue,
                              nsAString& aResultString) const override;
 
  protected:
Attached patch beta patch (obsolete) (deleted) — Splinter Review
Flags: needinfo?(emilio) → needinfo?(aryx.bugmail)

This was an issue with the original uplift in comment 18. It contained:

+
+== overflow-clip-box.html overflow-clip-box-ref.html
+!= overflow-clip-box.html overflow-clip-box-notref.html

in the reftest manifest which shouldn't be there (as it's a test for bug 1618260 which is not in beta).

Flags: needinfo?(emilio)
Attachment #9135556 - Attachment is obsolete: true
Attachment #9135556 - Attachment is patch: true

Verified as fixed using Firefox 75 beta 9 under Win 10 64-bit and Ubuntu 18.04 64-bit.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-triaged]
Flags: qe-verify+
Regressions: 1649569
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: