W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2012

Re: [DOM3 Events] Error between float vs. double of WheelEvent

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Sun, 18 Mar 2012 10:56:57 -0400
Message-ID: <4F65F7B9.8040303@mit.edu>
To: www-dom@w3.org
On 3/17/12 10:45 PM, Glenn Maynard wrote:
> Do any browsers actually implement WebIDL floats?

Gecko does, last I checked.

> This logs
> 0.10000000000000000555 (a double) in Firefox, Chrome and Opera, even
> though HTMLProgressElement.value is a float according to the spec:
> <progress value=0.1 id=x>
> <script>console.log(document.getElementById("x").value.toFixed(20))</script>
> If it was being rounded to a float, it would log 0.10000000149011611938.

The Gecko IDL for HTMLProgressElement says:

   attribute double value;

It may be that the spec used to say double instead of float and our IDL 
didn't get updated when the spec changed, or it may be that whoever 
wrote the IDL didn't read the spec carefully enough.  Either way, our 
IDL does NOT say float there.

WebKit's IDL for HTMLProgressElement says:

   attribute  double                value
     setter raises(DOMException);

which tends to support the "spec used to say 'double' and then changed" 

> All major desktop browsers seem to treat floating-point literals as
> doubles, at least.

Maybe.  Or maybe you picked a bad attribute to test?  Pick one that's 
been a float all along.

Note that as far as the original question in this thread goes I still 
need to look into what's going on here in Gecko.

Received on Sunday, 18 March 2012 14:57:26 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:19 UTC