diff --git a/index.html b/index.html index 6492370..8d5a8e8 100644 --- a/index.html +++ b/index.html @@ -1472,6 +1472,193 @@

feature/default allowlist=] is [=default allowlist/'self'=].

+
+

+ Automation +

+

+ For the purposes of user-agent automation and application testing, this + document defines extensions to the [[[WebDriver]]] and + [[[WebDriver-BiDi]]] specifications. It is OPTIONAL for a user agent to + support them. +

+
+        dictionary GeolocationMockCoordinates {
+          double accuracy = 1;
+          required double latitude;
+          required double longitude;
+          double? altitude = null;
+          double? altitudeAccuracy = null;
+          double? heading = null;
+          double? speed = null;
+        };
+      
+

+ To set the system coordinates given an optional + {{GeolocationMockCoordinates}} + |coordinates:GeolocationMockCoordinates|, and an optional [=user + agent=] |agent|: +

+
    +
  1. Let |targets| be a list containing all [=environment settings + object=] which belong to the |agent| if provided, or all [=user + agents=] otherwise. +
  2. +
  3. Let |tasks| be an [=list/empty=] [=list=]. +
  4. +
  5. For each |target| in |targets|: +
      +
    1. Queue a task |task| on the [=geolocation task source=] of + |target|'s [=relevant settings object=]'s [=global object=]'s + [=Window/browsing context=] to: +
        +
      1. If |coordinates| is not given, clear the system location + and thus make the position unavailable. +
      2. +
      3. Otherwise, set the system coordinates to match the values + of |coordinates|. +
      4. +
      +
    2. +
    3. Append |task| to |tasks|. +
    4. +
    +
  6. +
  7. Wait for all |tasks| to finish and return. +
  8. +
+

+ Set System Coordinates Web Driver Extension +

+ + + + + + + + + + + + + +
+ HTTP Method + + [=Extension command URI template|URI template=] +
+ POST + + /session/{session id}/geolocation +
+

+ The set system + coordinates [=extension command=] [=remote end steps=] are: +

+
    +
  1. If the |parameters| argument is the empty string: +
      +
    1. [=Set the system coordinates=]. +
    2. +
    3. Return |success| with data `null`. +
    4. +
    +
  2. +
  3. Let |coordinates| be the |parameters| argument [=converted to IDL + value=] of type {{GeolocationMockCoordinates}}. +
  4. +
  5. If the conversion [=exception/throws=], return an [=invalid + argument=] [=error=]. +
  6. +
  7. [=Set the system coordinates=] to |coordinates|. +
  8. +
  9. Return |success| with data `null`. +
  10. +
+

+ The `geolocation` Web Driver BiDi Module +

+

+ This section defines the `geolocation` [=extension module=] for the + [[WebDriver-BiDi]] specification. +

+

+ The `geolocation` module contains commands for setting the system's + geolocation coordinates and associated types. +

+

+ `GeolocationCommand` definition +

+

+ The `GeolocationCommand` [=remote end definition=] is as follows: +

+
+        GeolocationCommand = (
+          geolocation.setSystemCoordinates
+        )
+      
+

+ The `Coordinates` type +

+

+ The `Coordinates` of the geolocation module is defined as follows: +

+
+        geolocation.Coordinates = {
+          accuracy: float .default 1.0,
+          latitude: float,
+          longitude: float,
+          altitude: float / null .default null,
+          altitudeAccuracy: float / null .default null,
+          heading: float / null .default null,
+          speed: float / null .default null
+        }
+      
+

+ The `geolocation.setSystemCoordinates` command +

+
+        geolocation.setCoordinates = (
+          method: "geolocation.setCoordinates",
+          params: geolocation.SetCoordinates
+        )
+
+        geolocation.SetCoordinates = {
+          coordinates: geolocation.Coordinates,
+          ? userContext: text,
+        }
+      
+

+ The [=remote end steps=] with |session| and |command parameters| are: +

+
    +
  1. Let |user context id| be the value of |command + parameters|["userContext"], if present, and default otherwise. +
  2. +
  3. Let |agent| be the [=user agent=] that represents the user context + with the id |user context id|. +
  4. +
  5. If the "coordinates" field of |command parameters| is missing: +
      +
    1. [=Set the system coordinates=] to undefined and |agent|. +
    2. +
    3. Return [=success=] with data `null`. +
    4. +
    +
  6. +
  7. Let |coordinates| be the |command parameters| argument [=converted + to IDL value=] of type {{GeolocationMockCoordinates}}. +
  8. +
  9. If the conversion [=exception/throws=], return an [=error=] with + [=error code=] [=invalid argument=]. +
  10. +
  11. [=Set the system coordinates=] to |coordinates| and |agent|. +
  12. +
  13. Return [=success=] with data `null`. +
  14. +
+