Closed Bug 1577980 Opened 6 years ago Closed 6 years ago

[wpt-sync] Sync PR 18778 - Allow strings containing '.' after sign (ex: -.8) in Decimal::FromString.

Categories

(Core :: DOM: Core & HTML, task, P4)

task

Tracking

()

RESOLVED FIXED
mozilla71
Tracking Status
firefox71 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 18778 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/18778
Details from upstream follow.

Matthieu Rigolot <matthieu.rigolot@gmail.com> wrote:

Allow strings containing '.' after sign (ex: -.8) in Decimal::FromString.

Entering those strings in a \<input type=number> leads to validation messages not being displayed in certain cases:

  • rangeUnderflow (bug985330)
  • rangeOverflow
  • stepMisMatch

This is due to Decimal::FromString not recognizing it as valid, hence returning NaN incorrectly. decimal.h and the spec:
https://html.spec.whatwg.org/#valid-floating-point-number say it should be supported.

Fixes it and adds appropriate tests in wtf_unittests and in web_tests.

Bug: 985330
Change-Id: Ic3a3bb1ca855ebcc13f96aac16c31937a2cba0cd
Reviewed-on: https://chromium-review.googlesource.com/1773262
WPT-Export-Revision: 41867d780cca9251acafb7b0ac69edc7aa97d1f5

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core
Ran 3 tests and 151 subtests OK : 3 PASS : 148 FAIL : 3 New tests that have failures or other problems: /html/semantics/forms/constraints/form-validation-validity-rangeOverflow.html [INPUT in NUMBER status] The value is greater than max(special floating number): FAIL /html/semantics/forms/constraints/form-validation-validity-rangeUnderflow.html [INPUT in NUMBER status] The value is less than min(special floating number): FAIL /html/semantics/forms/constraints/form-validation-validity-stepMismatch.html [INPUT in NUMBER status] The step attribute is not set and the value attribute is a floating number: FAIL
Pushed by james@hoppipolla.co.uk: https://hg.mozilla.org/integration/mozilla-inbound/rev/900e5bcf83a2 [wpt PR 18778] - Allow strings containing '.' after sign (ex: -.8) in Decimal::FromString., a=testonly https://hg.mozilla.org/integration/mozilla-inbound/rev/a89d33b022f6 [wpt PR 18778] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
You need to log in before you can comment on or make changes to this bug.