Bug 49782
| Summary: | 255 stepUp()s for step=0.00392156863 is not 1. | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Dai Mikurube <dmikurube> |
| Component: | WebCore Misc. | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED CONFIGURATION CHANGED | ||
| Severity: | Normal | CC: | ahmad.saleem792, annevk, dmikurube |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | PC | ||
| OS: | All | ||
Dai Mikurube
How to reproduce:
1. <input type="number" min="0" value="0" step="0.00392156863" />
2. stepUp() for 255 times.
Expected:
1 (from an example at HTML5 spec. : 4.10.7.2.11 The step attribute)
Actual:
1.00000000065
Discussed at the bug 48976.
Hints:
I found we can calculate it if completely using IEEE 754 single precision numbers.
Re-considering precisions in calculation and printing may help.
Another option:
Re-consider the spec.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Ahmad Saleem
Chrome Canary 122 - 1.00000000065
Safari 17.2.1 - 1.00000000065
Firefox Nightly 123 - 1.00000000065
I didn't counted 255 clicks, I just moved using 'Up' key till reaching near 0.99xx to 1.xx.
I think web-spec is for 'double precision' number, so we can mark this as 'RESOLVED CONFIGURATION CHANGED'.