Closed Bug 833025 Opened 11 years ago Closed 6 years ago

No validity information on coordinates_interface

Categories

(Core :: DOM: Geolocation, defect, P5)

defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: stephenl, Unassigned)

References

Details

(Whiteboard: [W3C GEO SPEC])

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0
Build ID: 20130116073211

Steps to reproduce:

Checkout GeoLocation API:

http://www.w3.org/TR/geolocation-API/#coordinates_interface



Actual results:

No good way to do which field is valid. Using invalid value does not work well. For example: speed. negative, zero, positive are all possible values.

  interface Coordinates {
    readonly attribute double latitude;
    readonly attribute double longitude;
    readonly attribute double? altitude;
    readonly attribute double accuracy;
    readonly attribute double? altitudeAccuracy;
    readonly attribute double? heading;
    readonly attribute double? speed;
  };


Expected results:

Should define a validity field, or using similar API as Android: hasSpeed(), hasAccuracy(), and so on
OS: Windows 7 → Gonk (Firefox OS)
Hardware: x86_64 → ARM
Assignee: nobody → doug.turner
Status: UNCONFIRMED → NEW
Ever confirmed: true
The spec is weird here.  it says:

(for example for speed)

The speed attribute denotes the magnitude of the horizontal component of the hosting device's current velocity and is specified in meters per second. If the implementation cannot provide speed information, the value of this attribute must be null. Otherwise, the value of the speed attribute must be a non-negative real number. 

It seems that speed isn't provided, the value should be NAN or it shouldn't exist on the Coordinates object.
Well they use double and not unrestricted double so NaN is technically not a valid value then. And they are nullable so null could be used. Using NaN might have been nicer though, but I suspect it's too late now.
we'd have to recharter.  probably a good idea if it is a very small change.
(and by small change, i mean... we keep the charter's scope to a very narrow focus.  not another geopriv clusterf*)
Garvan, lets talk about this next time we see each other!
Assignee: dougt → gkeeley
Whiteboard: [W3C GEO SPEC]
See Also: → 645325
Assignee: garvankeeley+bmo → nobody
I don't think we need to fix this. The Geolocation API spec and MDN document the following invalid values.

https://www.w3.org/TR/geolocation-API/#coordinates_interface

https://developer.mozilla.org/en-US/docs/Web/API/Coordinates

(In reply to Stephen Li from comment #0)
> No good way to do which field is valid. Using invalid value does not work
> well. For example: speed. negative, zero, positive are all possible values.
> 
>   interface Coordinates {
>     readonly attribute double latitude;
>     readonly attribute double longitude;

The latitude and longitude properties are not optional.

>     readonly attribute double? altitude;

If the implementation cannot provide altitude information, the value of this attribute must be null. 

>     readonly attribute double accuracy;

It is specified in meters and must be supported by all implementations. The value of the accuracy attribute must be a non-negative real number. 

>     readonly attribute double? altitudeAccuracy;

If the implementation cannot provide altitude information, the value of this attribute must be null. Otherwise, the value of the altitudeAccuracy attribute must be a non-negative real number. 

>     readonly attribute double? heading;

If the implementation cannot provide heading information, the value of this attribute must be null. If the hosting device is stationary (i.e. the value of the speed attribute is 0), then the value of the heading attribute must be NaN. 

>     readonly attribute double? speed;

If the implementation cannot provide speed information, the value of this attribute must be null. Otherwise, the value of the speed attribute must be a non-negative real number.
Status: NEW → RESOLVED
Closed: 6 years ago
OS: Gonk (Firefox OS) → All
Priority: -- → P5
Hardware: ARM → All
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.