This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#valid-floating-point-number Multipage: http://www.whatwg.org/C#floating-point-numbers Complete: http://www.whatwg.org/c#floating-point-numbers Comment: Is it intentional that floating point numbers beginning with a dot are not a valid floating point numbers? It took a fair amount of reading through the spec to figure out why <input type="number" step=".5"> doesn't do what it looks like it should do. <input type="number" step="0.5"> of course works. Posted from: 69.251.188.87 User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7) AppleWebKit/534.48.3 (KHTML, like Gecko) Version/5.1 Safari/534.48.3
Yes, it is intentional. Maybe it should change?
Looks like Gecko already does this: <http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A...%3Cprogress%20value%3D.7%3E>
Seems like something that should change -- there's no reason to make this invalid that I see.
Opera also. Not WebKit.
It's been brought up elsewhere that we should just use the same algorithm as ECMAScript uses to parse floats. This seems like a good idea to me and would fix this issue.
That's bug 12220 -- which is currently WONTFIX, so you should probably reopen it if you want it fixed. I just looked again and discovered that this actually does affect implementer requirements, not just author requirements. ".5" isn't just invalid, parsing it returns an error. This seems very surprising. From the summary, I thought it was just an authoring requirement.
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document: http://dev.w3.org/html5/decision-policy/decision-policy.html Status: Accepted Change Description: see diff given below Rationale: Concurred with reporter's comments.
Checked in as WHATWG revision r6635. Check-in comment: Allow omission of the number before the period in a floating point number. http://html5.org/tools/web-apps-tracker?from=6634&to=6635