Skip to content
Snippets Groups Projects
Commit 5c947c8b authored by Jonathan Watt's avatar Jonathan Watt
Browse files

Bug 1004327 - Don't limit the number of significant fractional digits for <input type=number>. r=bz

parent 7d2eb4e7
No related branches found
No related tags found
No related merge requests found
......@@ -108,6 +108,10 @@ ICUUtils::LocalizeNumber(double aValue,
langTag.get(), nullptr, &status));
unum_setAttribute(format, UNUM_GROUPING_USED,
LocaleNumberGroupingIsEnabled());
// ICU default is a maximum of 3 significant fractional digits. We don't
// want that limit, so we set it to the maximum that a double can represent
// (14-16 decimal fractional digits).
unum_setAttribute(format, UNUM_MAX_FRACTION_DIGITS, 16);
int32_t length = unum_formatDouble(format, aValue, buffer, kBufferSize,
nullptr, &status);
NS_ASSERTION(length < kBufferSize &&
......
<!DOCTYPE html>
<html>
<body>
<input type="number" value="1.00100000000001" style="width:100%;">
</body>
</html>
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<script>
document.addEventListener("MozReftestInvalidate", function() {
document.getElementById("i").stepUp();
document.documentElement.className = "";
}, false);
</script>
</head>
<body>
<input id="i" type="number" value="1.001" step="0.00000000000001"
style="width:100%;">
</body>
</html>
......@@ -29,6 +29,9 @@ skip-if(B2G||Android) == number-min-height-2.html number-min-height-2-ref.html
skip-if(B2G||Android) == number-max-height-1.html number-max-height-1-ref.html
skip-if(B2G||Android) == number-max-height-2.html number-max-height-2-ref.html
# number of significant fractional digits:
== number-significant-fractional-digits.html number-significant-fractional-digits-ref.html
# focus
# autofocus is disabled on B2G
# https://bugzilla.mozilla.org/show_bug.cgi?id=965763
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment