diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2e708d7..861f329 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,3 +25,5 @@ contributors in the pull request's body or in subsequent comments. If you are making a pull request on behalf of someone else but you had no part in designing the feature, you can remove yourself with the above syntax. + +To build a local copy of the specification, please refer to [respec documentation](https://respec.org/docs/#using-command-line). diff --git a/index.html b/index.html index 43efdb7..cfb482f 100644 --- a/index.html +++ b/index.html @@ -752,6 +752,9 @@

change of geographic position is left to the implementation. User agents MAY impose a rate limit on how frequently position changes are reported. + User agents MUST consider + invoking [=set emulated position data=] as a significant + change.
  • If |document| is not [=Document/fully active=] or [=Document/visibility state=] is not "visible", go back to @@ -823,6 +826,38 @@

  • If |permission| is "granted":
      +
    1. + Check if an emulated position should be used by running + the following steps: +
        +
      1. Let |emulatedPositionData| be [=get emulated position data=] + passing [=this=]. +
      2. +
      3. If |emulatedPositionData| is not null: +
          +
        1. If |emulatedPositionData| is a {{GeolocationPositionError}}: +
            +
          1. [=Call back with error=] passing |errorCallback| and + |emulatedPositionData|. +
          2. +
          3. Terminate this algorithm.
          4. +
          +
        2. +
        3. Let |position| be [=a new `GeolocationPosition`=] + passing |emulatedPositionData|, |acquisitionTime| and + |options|.{{PositionOptions/enableHighAccuracy}}. +
        4. +
        5. [=Queue a task=] on the [=geolocation task source=] with + a step that [=invokes=] |successCallback| with + « |position| » and "`report`". +
        6. +
        7. Terminate this algorithm. +
        8. +
        +
      4. +
      +
      +
    2. Let |position| be null.
    3. If |cachedPosition| is not null, and @@ -1472,6 +1507,65 @@

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

      +
      +

      + Emulation +

      + +

      + For the purposes of user-agent automation and application testing, this + document defines geolocation emulations. +

      +

      + Each [=top-level traversable=] has an associated + emulated position data, which is data representing + {{GeolocationCoordinates}}, {{GeolocationPositionError}} or null, + initially null. +

      +

      + To set emulated position data, given + [=navigable=] |navigable| and an |emulatedPositionData|: +

      +
        +
      1. Assert |emulatedPositionData| is either null, a + {{GeolocationCoordinates}}, or a {{GeolocationPositionError}}. +
      2. +
      3. Let |traversable| be |navigable|’s [=navigable/top-level traversable=]. +
      4. +
      5. If |traversable| is not null: +
          +
        1. Set |traversable|'s associated [=emulated position data=] to + |emulatedPositionData|. +
        2. +
        3. User agents MUST consider this as a "significant change" in the + wait for a significant change of + geographic position step. +
        4. +
        +
      6. +
      +

      + To get emulated position data, given {{Geolocation}} + |geolocation|: +

      +
        +
      1. Let |navigable| be |geolocation|'s [=relevant global object=]'s + [=associated `Document`=]'s [=node navigable=]. +
      2. +
      3. If |navigable| is null, return null. +
      4. +
      5. Let |traversable| be |navigable|’s [=navigable/top-level traversable=]. +
      6. +
      7. If |traversable| is null, return null. +
      8. +
      9. Return |traversable|'s associated [=emulated position data=]. +
      10. +
      +
      +