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

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" 
hypothesis...

> 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.

-Boris

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