Re: Inconsistent definition of timeout / maximumAge in Geo v1

Hi Dom,
         Good points. Some comments:

1) 0 cannot be used to represent Infinity in this case, as the value 0 has
meaning here:
      1a) timeout =0, it means you can only retreive cached poisition, you
don't have time to do any new location activity (eg: gps, wifi scanning),
      1b) maximumAge=0, means don't use any cached position, compute a
"new" position now.

  Your test case: If timeout is explicitly specified as 0, and no
maximumAge specified( i.e. it will use default of 0), then you should
always get timeout error. Since the maximumAge choice of zero forces you to
get a "new" position, while timeout of zero forces you not to have time to
do any new activity, except retrieve cached position.

3) You are right about "long maximumAge" responding to "Infinity" might not
be consistent with long defn by WebIDL. (
http://www.w3.org/TR/WebIDL/#idl-long ). I'm very new at this, so we should
get more experts on WebIDL to comment on this.
     In Javascript, type is not explicit, so variables like 'var maxAge =
Infinity' may be getting cast  somewhere along the way to a large number in
implementation when interpreted as long. (If implementations are working
properly)

2) the timeout attribute in the PositionOptions interface is defined as
"long", with a default value of Infinity. This may still be consistent with
WebIDL, as the spec states that the IMPLEMENTATION should consider absence
of this parameter as an INTERNAL value of infinity: it does not explicitly
state that a value of "Infinity" can be assigned to "timeout". This is a
terminology argument. My bad. couldn't resist;)

I agree with you. We should get this clarified if long" cannot take value
"Infinity" in WebIDL.
Regards
Ravi Dandu
Mozilla Corp, Product Management

On Mon, Feb 3, 2014 at 8:34 AM, Dominique Hazael-Massieux <dom@w3.org>wrote:

> Hi,
>
> While looking at Ms2ger's error reports [1] suggesting to turn
> PositionOptions in a dictionary in Geo v1 [2], I discovered the
> following inconsistency in the specification:
> * the timeout attribute in the PositionOptions interface is defined as
> "long", with a default value of Infinity
> * the maximumAge attribute of that same interface is also of type
> "long", and described in prose as responding to the Infinity value
> * yet, the "long" type doesn't accept "Infinity" as a valid value (more
> specifically, it casts it to "0")
>
> As far as I can tell, WebIDL doesn't have the notion of infinite integer
> values, so I'm not quite sure what the correct way to handle this is.
>
> In XHR, timeout = 0 means no timeout, but at least in Chrome, timeout =
> 0 triggers immediately the timeout error. (for some reason, my Firefox
> is not cooperating with my testing of this)
>
> And the = 0 trick wouldn't do for maximumAge in any case.
>
> Thoughts?
>
> Dom
>
> 1.
> http://lists.w3.org/Archives/Public/public-geolocation/2012Jan/0001.html
> 2. http://www.w3.org/TR/geolocation-API/
>
>
>
>

Received on Tuesday, 4 February 2014 12:53:25 UTC