Bug 24506

Summary: Geolocation in Safari differs from the spec, no Coordinates attribute on Position
Product: WebKit Reporter: Greg Bolsinga <bolsinga>
Component: WebCore JavaScriptAssignee: Greg Bolsinga <bolsinga>
Severity: Normal CC: koivisto, sam
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Description Flags
This patch implements the needed changes
Updated patch includes maximumAge in PositionOptions
forgot to update ChangeLog file koivisto: review+

Description Greg Bolsinga 2009-03-10 18:56:06 PDT
The spec at http://dev.w3.org/geo/api/spec-source.html specifies that there should be a Coordinates attribute (coords) on the Position interface, which encapsulates lat, long, altitude, accuracy, etc.  But our version doesn't have the Coordinates attribute.  In our implementation, lat, long, accuracy, etc are attributes on Position.

From the spec:

"The Position interface is the container for the geolocation information returned by this API. This version of the specification allows one attribute of type Coordinates and a timestamp. Future versions of the API may allow additional attributes that provide other information about this position (e.g. street addresses).

  interface Position {
    readonly attribute Coordinates coords;
    readonly attribute DOMTimeStamp timestamp;

The coords attribute contains a set of geographic coordinates together with their associated accuracy, as well as a set of other optional attributes such as altitude and speed.

The timestamp attribute represents the time when the Position object was acquired and is represented as a DOMTimeStamp [DOMTIMESTAMP].

Coordinates interface

  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;
Comment 1 Greg Bolsinga 2009-03-10 18:56:42 PDT
Comment 2 Greg Bolsinga 2009-03-10 21:36:47 PDT
Created attachment 28462 [details]
This patch implements the needed changes

This add a Coordinates method to the Position in Geolocation.
Comment 3 Greg Bolsinga 2009-03-11 13:53:52 PDT
It is also missing PositionOptions.maximumAge.
Comment 4 Greg Bolsinga 2009-03-11 14:44:41 PDT
Created attachment 28493 [details]
Updated patch includes maximumAge in PositionOptions

Updated to include maximumAge.
Comment 5 Greg Bolsinga 2009-03-11 14:47:10 PDT
Created attachment 28494 [details]
forgot to update ChangeLog file
Comment 6 Antti Koivisto 2009-03-12 13:57:26 PDT
Comment on attachment 28494 [details]
forgot to update ChangeLog file

r=me, looks good.

Geolocation related sources would probably deserve a subdirectory of their own at some point.
Comment 7 Greg Bolsinga 2009-03-12 14:21:55 PDT
bolsinga:WebKit bolsinga$ svn commit
Sending        WebCore/ChangeLog
Sending        WebCore/DerivedSources.make
Sending        WebCore/GNUmakefile.am
Sending        WebCore/WebCore.pro
Sending        WebCore/WebCore.scons
Sending        WebCore/WebCore.vcproj/WebCore.vcproj
Sending        WebCore/WebCore.xcodeproj/project.pbxproj
Sending        WebCore/WebCoreSources.bkl
Sending        WebCore/bindings/js/JSGeolocationCustom.cpp
Adding         WebCore/page/Coordinates.cpp
Adding         WebCore/page/Coordinates.h
Adding         WebCore/page/Coordinates.idl
Sending        WebCore/page/Geoposition.cpp
Sending        WebCore/page/Geoposition.h
Sending        WebCore/page/Geoposition.idl
Sending        WebCore/page/PositionOptions.h
Sending        WebCore/platform/mac/GeolocationServiceMac.mm
Transmitting file data .................
Committed revision 41650.