diff --git a/index.html b/index.html index 5befb48..612174a 100644 --- a/index.html +++ b/index.html @@ -349,7 +349,7 @@

Navigator interface extensions

         partial interface Navigator {
-          readonly attribute Geolocation geolocation;
+          readonly attribute NavigatorGeolocation geolocation;
         };
       

The geolocation attribute gives access to location information associated @@ -359,18 +359,17 @@

Navigator interface extensions

-
-

Geolocation interface

+
+

NavigatorGeolocation interface

-

The Geolocation object is +

The NavigatorGeolocation object is used by scripts to programmatically determine the location information associated with the hosting device. The location information is acquired - by applying a user-agent specific algorithm, creating a Position object, and populating that object + by applying a user-agent specific algorithm, creating a NavigatorGeolocationPosition object, and populating that object with appropriate data accordingly.

- [NoInterfaceObject]
- interface Geolocation {
+ interface NavigatorGeolocation {
    void getCurrentPosition(PositionCallback successCallback,
                            optional PositionErrorCallback errorCallback,
                            optional PositionOptions options);
@@ -382,9 +381,9 @@ 

Geolocation interface

void clearWatch(long watchId); }; - callback PositionCallback = void (Position position); + callback PositionCallback = void (NavigatorGeolocationPosition position); - callback PositionErrorCallback = void (PositionError positionError); + callback PositionErrorCallback = void (PositionErrorPositionError positionError);

The getCurrentPosition() @@ -393,23 +392,23 @@

Geolocation interface

location of the device. If the attempt is successful, the successCallback MUST be invoked (i.e. the handleEvent operation MUST be called on the - callback object) with a new Position object, + callback object) with a new NavigatorGeolocationPosition object, reflecting the current location of the device. If the attempt fails, the errorCallback MUST be invoked with a - new PositionError object, reflecting the reason for the failure.

+ new NavigatorGeolocationPositionError object, reflecting the reason for the failure.

-

The implementation of the getCurrentPosition method +

The implementation of the getCurrentPosition method MUST execute the following set of steps:

    -
  1. If a cached Position object, whose age is no greater +
  2. If a cached NavigatorGeolocationPosition object, whose age is no greater than the value of the maximumAge variable, is available, invoke the successCallback with the - cached Position object as a parameter and exit + cached NavigatorGeolocationPosition object as a parameter and exit this set of steps.
  3. If the value of the timeout variable is 0, invoke the errorCallback (if present) with a - new PositionError object whose code - attribute is set to TIMEOUT and exit this set of steps.
  4. + new NavigatorGeolocationPositionError object whose code + attribute is set to TIMEOUT and exit this set of steps.
  5. Start a location acquisition operation (e.g. by invoking a platform-specific API), possibly taking into account the value of the enableHighAccuracy variable.
  6. @@ -418,18 +417,18 @@

    Geolocation interface

    timer fires, cancel any ongoing location acquisition operations associated with this instance of the steps, invoke the errorCallback (if present) - with a new PositionError object - whose code attribute is set to TIMEOUT, and + with a new NavigatorGeolocationPositionError object + whose code attribute is set to TIMEOUT, and exit this set of steps.
  7. If the operation completes successfully before the timeout expires, cancel the pending timer, invoke - the successCallback with a new Position + the successCallback with a new NavigatorGeolocationPosition object that reflects the result of the acquisition operation and exit this set of steps.
  8. If the operation fails before the timeout expires, cancel the pending timer and invoke the errorCallback (if - present) with a new PositionError object - whose code is set to POSITION_UNAVAILABLE.
  9. + present) with a new NavigatorGeolocationPositionError object + whose code is set to POSITION_UNAVAILABLE.

The watchPosition() @@ -439,10 +438,10 @@

Geolocation interface

operation. This operation MUST first attempt to obtain the current location of the device. If the attempt is successful, the successCallback MUST be invoked (i.e. the handleEvent operation MUST be called on the - callback object) with a new Position object, + callback object) with a new NavigatorGeolocationPosition object, reflecting the current location of the device. If the attempt fails, the errorCallback MUST be invoked with a - new PositionError object, reflecting the reason for + new NavigatorGeolocationPositionError object, reflecting the reason for the failure. The watch process then MUST continue to monitor the position of the device and invoke the appropriate callback every time this position changes. The watch process @@ -450,21 +449,21 @@

Geolocation interface

the clearWatch() method is called with the corresponding identifier.

-

The PositionCallBack callback is invoked when a Position object is available, resulting +

The PositionCallBack callback is invoked when a NavigatorGeolocationPosition object is available, resulting from a cached object or the acquisition operation. The PositionCallBack callback gets set using the successCallback parameter.

-

The PositionErrorCallBack callback is invoked when a Position object is not available, resulting +

The PositionErrorCallBack callback is invoked when a NavigatorGeolocationPosition object is not available, resulting from a timeout, a permission denied, or an unability to determine the position of the device. The PositionErrorCallBack callback gets set using the errorCallback parameter.

The implementation of the watch process MUST execute the following set of steps:

    -
  1. If a cached Position object, whose age is no greater +
  2. If a cached NavigatorGeolocationPosition object, whose age is no greater than the value of the maximumAge variable, is available, invoke the successCallback with the - cached Position object as a parameter.
  3. + cached NavigatorGeolocationPosition object as a parameter.
  4. Register to receive system events that indicate that the position of the device MAY have changed (e.g. by listening or polling for changes in WiFi or cellular signals).
  5. @@ -480,8 +479,8 @@

    Geolocation interface

    milliseconds denoted by the value of the timeout variable. When the timer fires, invoke the errorCallback (if present) with a - new PositionError object whose code - attribute is set to TIMEOUT and jump to step 6. + new NavigatorGeolocationPositionError object whose code + attribute is set to TIMEOUT and jump to step 6.
  6. If the location acquisition operation successfully yields a new position before the timeout expires, perform the following two steps: @@ -492,7 +491,7 @@

    Geolocation interface

  7. If the new position differs significantly from the previous position, invoke the successCallback with a - new Position object that reflects the + new NavigatorGeolocationPosition object that reflects the result of the acquisition operation. This step MAY be subject to callback rate limitation (see below).
  8. @@ -500,8 +499,8 @@

    Geolocation interface

  9. Else, if the location acquisition operation reports an error before the timeout expires, invoke the errorCallback (if present) - with a new PositionError object - whose code is set to POSITION_UNAVAILABLE. This + with a new NavigatorGeolocationPositionError object + whose code is set to POSITION_UNAVAILABLE. This step MAY be subject to callback rate limitation (see below).
@@ -530,7 +529,7 @@

Geolocation interface

described above. If the user grants permission, the appropriate callback MUST be invoked as described above. If the user denies permission, the errorCallback (if present) - MUST be invoked with code PERMISSION_DENIED, irrespective of any + MUST be invoked with code PERMISSION_DENIED, irrespective of any other errors encountered in the above steps. The time that is spent obtaining the user permission MUST NOT be included in the period covered by the timeout attribute @@ -550,7 +549,7 @@

Geolocation interface

PositionOptions interface

-

The getCurrentPosition() and watchPosition() methods +

The getCurrentPosition() and watchPosition() methods accept PositionOptions objects as their third argument. @@ -582,52 +581,51 @@

PositionOptions interface

especially useful for applications running on battery-powered devices, such as mobile phones.

The timeout attribute denotes the maximum length of time (expressed in milliseconds) that is allowed - to pass from the call to getCurrentPosition or watchPosition + to pass from the call to getCurrentPosition or watchPosition until the corresponding successCallback is invoked. If the implementation is unable to successfully acquire a - new Position before the given timeout elapses, and no other errors have occurred in this interval, then - the corresponding errorCallback MUST be invoked with a PositionError object whose code attribute - is set to TIMEOUT. Note that the time that is spent obtaining the user permission is + new NavigatorGeolocationPosition before the given timeout elapses, and no other errors have occurred in this interval, then + the corresponding errorCallback MUST be invoked with a NavigatorGeolocationPositionError object whose code attribute + is set to TIMEOUT. Note that the time that is spent obtaining the user permission is not included in the period covered by the timeout attribute. The timeout attribute only applies to the location acquisition operation. -

In case of a getCurrentPosition() call, the +

In case of a getCurrentPosition() call, the errorCallback would be invoked at most once.

In case of - a watchPosition(), + a watchPosition(), the errorCallback could be invoked repeatedly: the first timeout is relative to the - moment watchPosition() + moment watchPosition() was called or the moment the user's permission was obtained, if that was necessary. Subsequent timeouts are relative to the moment when the implementation determines that the position of the hosting device has changed and a new - Position object MUST be acquired. + NavigatorGeolocationPosition object MUST be acquired.

The maximumAge attribute indicates that the application is willing to accept a cached position whose age is no greater than the specified time in milliseconds. If maximumAge is set to 0, the implementation MUST immediately attempt to acquire a new position object. Setting the maximumAge to Infinity MUST determine the implementation to return a cached position regardless of its age. If an implementation does not have a cached position available whose age is no greater than the specified maximumAge, - then it MUST acquire a new Position object. In case of a watchPosition(), - the maximumAge refers to the first Position object returned by the implementation. + then it MUST acquire a new NavigatorGeolocationPosition object. In case of a watchPosition(), + the maximumAge refers to the first NavigatorGeolocationPosition object returned by the implementation.

-
-

Position interface

+
+

NavigatorGeolocationPosition interface

-

The Position interface is the +

The NavigatorGeolocationPosition 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 + version of the specification allows one attribute of type NavigatorGeolocationCoordinates and a timestamp. Future versions of the API MAY allow additional attributes that provide other information about this position (e.g. street addresses).

-  [NoInterfaceObject]
-  interface Position {
-    readonly attribute Coordinates coords;
+  interface NavigatorGeolocationPosition {
+    readonly attribute NavigatorGeolocationCoordinates coords;
     readonly attribute DOMTimeStamp timestamp;
   };
   
@@ -637,15 +635,14 @@

Position interface

a set of other optional attributes such as altitude and speed.

The timestamp attribute represents - the time when the Position object was + the time when the NavigatorGeolocationPosition object was acquired and is represented as a DOMTimeStamp.

-
-

Coordinates interface

+
+

NavigatorGeolocationCoordinates interface

-  [NoInterfaceObject]
-  interface Coordinates {
+  interface NavigatorGeolocationCoordinates {
     readonly attribute double latitude;
     readonly attribute double longitude;
     readonly attribute double? altitude;
@@ -697,12 +694,11 @@ 

Coordinates interface

-
-

PositionError interface

+
+

NavigatorGeolocationPositionError interface

-  [NoInterfaceObject]
-  interface PositionError {
+  interface NavigatorGeolocationPositionError {
     const unsigned short PERMISSION_DENIED = 1;
     const unsigned short POSITION_UNAVAILABLE = 2;
     const unsigned short TIMEOUT = 3;
@@ -732,7 +728,7 @@ 

PositionError interface

The length of time specified by the timeout property has elapsed before the implementation could successfully acquire a - new Position object. + new NavigatorGeolocationPosition object.