From 73fc23d80386b8e5ce72d337e66753fe9b3265f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Mon, 24 Jan 2022 19:19:50 +1100 Subject: [PATCH 01/13] fix "Queue a task" / "in parallel" usage --- index.html | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index e34011b..bfe0da5 100644 --- a/index.html +++ b/index.html @@ -639,7 +639,7 @@

  1. If [=this=]'s {{Geolocation/[[watchTasks]]}}[|watchId|] - [=map/exists=], [=map/remove=] [=this=]'s + [=list/exists=], [=list/remove=] [=this=]'s {{Geolocation/[[watchTasks]]}}[|watchId|].
@@ -665,10 +665,7 @@

  • [=Set/Append=] |watchId| to |watchTasks|.
  • -
  • Let |global| be [=this=]'s [=relevant global object=]. -
  • -
  • [=Queue a global task=] using the [=geolocation task source=] - with |global| to run the following steps [=in parallel=]: +
  • Return |watchId| and [=in parallel=]:
    1. Do security check.
        @@ -678,7 +675,8 @@

      1. [=Call back with error=] |errorCallback| and {{GeolocationPositionError/PERMISSION_DENIED}}.
      2. -
      3. [=List/Remove=] |watchId| from |watchTasks|. +
      4. [=Queue a task=] on the [=geolocation task source=] + to [=List/remove=] |watchId| from |watchTasks|.
      5. Terminate this algorithm.
      6. @@ -705,7 +703,8 @@

        [=Check permission=] passing |errorCallback|. If the check returns failure:
          -
        1. [=List/Remove=] |watchId| from |watchTasks|. +
        2. [=Queue a task=] on the [=geolocation task source=] to + [=List/remove=] |watchId| from |watchTasks|.
        3. Terminate this algorithm.
        4. @@ -832,7 +831,8 @@

          1. If |repeats| is false:
              -
            1. [=List/Remove=] |watchId| from |watchTasks|. +
            2. [=Queue a task=] on the [=geolocation task source=] + to [=List/remove=] |watchId| from |watchTasks|.
            3. Terminate this algorithm.
            4. @@ -873,8 +873,6 @@

          2. -
          3. Return |watchId|. -
          From 515adc4e72c0c1000bb48b040a3fa0844ab91a36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Thu, 27 Jan 2022 20:35:10 +1100 Subject: [PATCH 02/13] rewrite algos to deal to parallel and timeout --- index.html | 490 ++++++++++++++++++++++++++--------------------------- 1 file changed, 243 insertions(+), 247 deletions(-) diff --git a/index.html b/index.html index bfe0da5..55700dc 100644 --- a/index.html +++ b/index.html @@ -129,8 +129,8 @@

          has received the following changes:

            -
          • [=Request position=] only proceeds when a document is visible, or - the document becomes visible. +
          • [=Request a position=] only proceeds when a document is visible, + or the document becomes visible.
          • Clarified how caching works as part of [=acquiring a position=]: only last position is cached, and can be evicted at any time. @@ -441,14 +441,14 @@

            that can govern the usage and access to users' location data.

            - Recipients ought to only request position information when necessary, - and only use the location information for the task for which it was - provided to them. Recipients ought to dispose of location information - once that task is completed, unless expressly permitted to retain it - by the user. Recipients need to also take measures to protect this - information against unauthorized access. If location information is - stored, users need to be allowed to update and delete this - information. + Recipients ought to only request a position information when + necessary, and only use the location information for the task for + which it was provided to them. Recipients ought to dispose of + location information once that task is completed, unless expressly + permitted to retain it by the user. Recipients need to also take + measures to protect this information against unauthorized access. If + location information is stored, users need to be allowed to update + and delete this information.

            The recipients of location information need to refrain from @@ -488,6 +488,25 @@

            interfaces that enable revocation of permissions.

          +
          +

          + Checking permission to use the API +

          +

          + The Geolocation API is a [=default powerful feature=]. +

          +

          + When check permission + to use the API, a user agent MAY suggest time-based [=permission=] + [=permission/lifetimes=], such as "24 hours", "1 week", or choose to + remember the permission [permission/grant=] indefinitely. However, it + is RECOMMENDED that a user agent prioritize restricting the + [=permission=] [=permission/lifetime=] to a single session: This can + be, for example, until the [=environment settings object/realm=] is + destroyed, the end-user [=navigates=] away from the [=origin=], or + the relevant browser tab is closed. +

          +

          @@ -569,12 +588,11 @@

          - [[\watchTasks]] + [[\watchIDs]] - Initialized as an empty [=set=] of {{unsigned long}} - [=set/item|items=], which represent the identifier for timed - [=task=]. + Initialized as an empty [=list=] of {{unsigned long}} + [=list/item|items=]. @@ -591,14 +609,17 @@

          1. If the [=current settings object=]'s [=associated `Document`=] is - not [=Document/fully active=], [=call back with error=] - |errorCallback| and - {{GeolocationPositionError/POSITION_UNAVAILABLE}}. -
          2. -
          3. Otherwise, [=request position=], passing |successCallback|, - |errorCallback|, |options|, and (repeats) false. + not [=Document/fully active=]: +
              +
            1. [=Call back with error=] |errorCallback| and + {{GeolocationPositionError/POSITION_UNAVAILABLE}}. +
            2. +
            3. Terminate this algorithm. +
            4. +
          4. -
          5. Return `undefined`. +
          6. [=In parallel=], [=request a position=] passing + |successCallback|, |errorCallback|, and |options|.

          @@ -616,15 +637,21 @@

        5. If the [=current settings object=]'s [=associated `Document`=] is not [=Document/fully active=]:
            -
          1. [=Call back with error=] |errorCallback| and +
          2. [=Call back with error=] passing |errorCallback| and {{GeolocationPositionError/POSITION_UNAVAILABLE}}.
          3. Return 0.
        6. -
        7. Let |watchId:long| be [=request position=], passing - |successCallback|, |errorCallback|, |options|, and (repeats) true. +
        8. Let |watchId:unsigned long| be an [=implementation-defined=] + {{unsigned long}} that is greater than zero. +
        9. +
        10. [=List/Append=] |watchId| to [=this=]'s + {{Geolocation/[[watchIDs]]}}. +
        11. +
        12. [=In parallel=], [=request a position=] passing + |successCallback|, |errorCallback|, |options|, and |watchId|.
        13. Return |watchId|.
        14. @@ -638,218 +665,73 @@

          When clearWatch() is invoked, the user agent MUST:

            -
          1. If [=this=]'s {{Geolocation/[[watchTasks]]}}[|watchId|] - [=list/exists=], [=list/remove=] [=this=]'s - {{Geolocation/[[watchTasks]]}}[|watchId|]. +
          2. [=List/Remove=] |watchId| from [=this=]'s + {{Geolocation/[[watchIDs]]}}.

          - Request position + Request a position

          - Request position by passing a {{PositionCallback}} - |successCallback:PositionCallback|, a {{PositionErrorCallback}}`?` - |errorCallback:PositionErrorCallback|, {{PositionOptions}} - |options:PositionOptions|, a {{boolean}} |repeats:boolean|, and - optionally (and only if |repeats| is true) a |previousId:long|. + To request a position, pass a {{PositionCallback}} + |successCallback:PositionCallback|, a {{PositionErrorCallback?}} + |errorCallback:PositionErrorCallback?|, {{PositionOptions}} + |options:PositionOptions|, and an optional |watchId:long|:

            -
          1. Let |watchTasks:Set| be [=this=]'s - {{Geolocation/[[watchTasks]]}}. -
          2. -
          3. If |previousId| was provided, let |watchId:long| be |previousId|; - Otherwise, let |watchId:long| be an [=implementation-defined=] - {{long}} that is greater than or equal to zero. +
          4. Let |watchIDs:List| be [=this=]'s {{Geolocation/[[watchIDs]]}}.
          5. -
          6. [=Set/Append=] |watchId| to |watchTasks|. +
          7. Let |document:Document| be the [=current settings object=]'s + [=associated Document=].
          8. -
          9. Return |watchId| and [=in parallel=]: +
          10. If |document:Document|'s [=Document/visibility state=] is + "hidden", wait for the following [=page visibility change steps=] to + run:
              -
            1. Do security check. -
                -
              1. If the environment settings object is a - [=non-secure context=], then: -
                  -
                1. [=Call back with error=] |errorCallback| and - {{GeolocationPositionError/PERMISSION_DENIED}}. -
                2. -
                3. [=Queue a task=] on the [=geolocation task source=] - to [=List/remove=] |watchId| from |watchTasks|. -
                4. -
                5. Terminate this algorithm. -
                6. -
                -
              2. -
              +
            2. Assert: |document|'s [=Document/visibility state=] is + "visible".
            3. -
            4. Let |document:Document| be the [=current settings object=]'s - [=associated Document=]. +
            5. Continue to the next steps below.
            6. -
            7. If |document:Document|'s [=Document/visibility state=] is - "hidden", wait for the following [=page visibility change steps=] - steps to run: -
                -
              1. Assert: |document|'s [=Document/visibility state=] is - "visible". -
              2. -
              3. Continue to the next step below. -
              4. -
              -
            8. -
            9. - [=Check permission=] passing |errorCallback|. If the check - returns failure: -
                -
              1. [=Queue a task=] on the [=geolocation task source=] to - [=List/remove=] |watchId| from |watchTasks|. -
              2. -
              3. Terminate this algorithm. -
              4. -
              +
            +
          11. +
          12. Let |descriptor| be a new {{PermissionDescriptor}} whose + {{PermissionDescriptor/name}} is "geolocation". +
          13. +
          14. Set |permission| to [=request permission to use=] |descriptor|. +
          15. +
          16. + If |permission| is "denied", then: +
              +
            1. [=List/Remove=] |watchId| from |watchIDs|.
            2. -
            3. - Acquire - position. -
                -
              1. Let |acquisitionTime:EpochTimeStamp| be a new - {{EpochTimeStamp}} that represents now. -
              2. -
              3. If |options|.{{PositionOptions/maximumAge}} is greater - than 0, and |cachedPosition| is not null: -
                  -
                1. Let |cachedPosition:GeolocationPosition| be - [=this=]'s {{Geolocation/[[cachedPosition]]}}. -
                2. -
                3. Let |cacheTime:long| be |acquisitionTime| minus the - value of |options|.{{PositionOptions/maximumAge}} member. -
                4. -
                5. If |cachedPosition|'s - {{GeolocationPosition/timestamp}}'s value is greater than - |cacheTime|, and - |cachedPosition|.{{GeolocationPosition/[[isHighAccuracy]]}} - equals |options|.{{PositionOptions/enableHighAccuracy}}: -
                    -
                  1. [=Queue a task=] on the [=geolocation task - source=] with a step that [=invokes=] - |successCallback| with |cachedPosition|. -
                  2. -
                  3. Go to determine - repetition steps below. -
                  4. -
                  -
                6. -
                -
              4. -
              5. Let |timeout:Task| be a new timed [=task=] that runs in - |options|.{{PositionOptions/timeout}} milliseconds after - |acquisitionTime|, which performs the following sub-steps: - -
                  -
                1. If the entry for |timerId| in the [=list of active - timers=] has been cleared, then abort these steps. -
                2. -
                3. [=Call back with error=] with |errorCallback| and - {{GeolocationPositionError/TIMEOUT}}. -
                4. -
                -
              6. -
              7. Let |timerId:long| be an [=implementation-defined=] - identifier that represents |timeout|. -
              8. -
              9. Add |timerId| to the [=list of active timers=]. -
              10. -
              11. Try to acquire the device's position, optionally taking - into consideration the value of - |options|.{{PositionOptions/enableHighAccuracy}}: -
                  -
                1. If acquiring a position succeeds: -
                    -
                  1. Let |position:GeolocationPosition| be [=a new - `GeolocationPosition`=] passing |acquisitionTime| and - |options|.{{PositionOptions/enableHighAccuracy}}. -
                  2. -
                  3. Set [=this=]'s {{Geolocation/[[cachedPosition]]}} - to |position|. -
                  4. -
                  5. [=Queue a task=] on the [=geolocation task - source=] with a step that [=invokes=] - |successCallback| with |position|. -
                  6. -
                  -
                2. -
                3. If acquiring a position fails because of one of the - following reasons: -
                  -
                  - Underlying system denies permission: -
                  -
                  -

                  - [=Call back with error=] passing |errorCallback| - and - {{GeolocationPositionError/PERMISSION_DENIED}}. -

                  - -
                  -
                  - Data acquisition error: -
                  -
                  - [=Call back with error=] passing |errorCallback| - and - {{GeolocationPositionError/POSITION_UNAVAILABLE}}. -
                  -
                  -
                4. -
                -
              12. -
              13. Clear |timerId| from the [=list of active timers=]. -
              14. -
              +
            4. [=Call back with error=] passing |errorCallback| and + {{GeolocationPositionError/PERMISSION_DENIED}}.
            5. -
            6. - Determine repetition. -
                -
              1. If |repeats| is false: -
                  -
                1. [=Queue a task=] on the [=geolocation task source=] - to [=List/remove=] |watchId| from |watchTasks|. -
                2. -
                3. Terminate this algorithm. -
                4. -
                -
              2. -
              +
            7. Terminate this algorithm.
            8. +
            +
          17. +
          18. Wait to [=acquire a position=] passing |successCallback|, + |errorCallback|, |options|, and |watchId|. +
          19. +
          20. If |watchId| was not passed, terminate this algorithm. +
          21. +
          22. While |watchIDs| [=list/contains=] |watchId|: +
            1. Wait for a significant change of geographic position. What constitutes a significant change of geographic position is left to the implementation. - User agents MAY impose a rate limit on the frequency position - changes. + User agents MAY impose a rate limit on how frequently position + changes are reported.
            2. -
            3. If |document| is not [=Document/fully active=] or not - [=Document/visibility state=] is "visible", go back to the - previous step and again wait for +
            4. If |document| is not [=Document/fully active=] or + [=Document/visibility state=] is not "visible", go back to the + previous step and again wait for a significant change of geographic position.
            5. -
            6. If |watchTasks| [=list/contain|contains=] |watchId|, then: -
                -
              1. [=Request position=] passing |successCallback|, - |errorCallback|, |options|, |repeats|, and |watchId|. -
              2. -
              +
            7. Attempt to [=acquire a position=] passing |successCallback|, + |errorCallback|, |options|, and |watchId|.
          -
          +

          - Check permission + Acquire a position

          - The Geolocation API is a [=default powerful feature=]. -

          -

          - The user agent MAY suggest time-based [=permission=] - [=permission/lifetimes=], such as "24 hours", "1 week", or choose to - remember the permission [permission/grant=] indefinitely. However, it - is RECOMMENDED that a user agent prioritize restricting the - [=permission=] [=permission/lifetime=] to a single session: This can - be, for example, until the [=environment settings object/realm=] is - destroyed, the end-user [=navigates=] away from the [=origin=], or - the relevant browser tab is closed. -

          -

          - When instructed to check permission, given a - {{PositionErrorCallback}}`?` |errorCallback:PositionErrorCallback|: + To acquire a position, + passing {{PositionCallback}} |successCallback:PositionCallback|, a + {{PositionErrorCallback?}} |errorCallback:PositionErrorCallback?|, + {{PositionOptions}} |options:PositionOptions|, and an optional + |watchId:long|.

            -
          1. Let |permission:PermissionState| be [=request permission to use=] - "geolocation". +
          2. If |watchId| was passed and [=this=]'s + {{Geolocation/[[watchIDs]]}} does not [=list/contain=] |watchId|, + terminate this algorithm.
          3. -
          4. If |permission| is - {{PermissionState/"denied"}}, then: +
          5. Let |acquisitionTime:EpochTimeStamp| be a new {{EpochTimeStamp}} + that represents now. +
          6. +
          7. Let |timeoutTime| be the sum of |acquisitionTime| and + |options|.{{PositionOptions/timeout}}. +
          8. +
          9. Let |cachedPosition:GeolocationPosition| be [=this=]'s + {{Geolocation/[[cachedPosition]]}}. +
          10. +
          11. Create an implementation-specific |timeout| task that elapses at + |timeoutTime|, during which it tries to acquire the device's position + by running the following steps:
              -
            1. [=Call back with error=] |errorCallback| and - {{GeolocationPositionError/PERMISSION_DENIED}}. +
            2. Let |permission| be [=get the current permission state=] of + "geolocation". +
            3. +
            4. If |permission| is "denied": +
                +
              1. Stop |timeout|. +
              2. +
              3. Do the user or system denied + permission failure case step. +
              4. +
            5. -
            6. Return failure. +
            7. If |permission| is "granted": +
                +
              1. Let |position| be null. +
              2. +
              3. If |cachedPosition| is not null, and + |options|.{{PositionOptions/maximumAge}} is greater than 0: +
                  +
                1. Let |cacheTime:long| be |acquisitionTime| minus the + value of the |options|.{{PositionOptions/maximumAge}} + member. +
                2. +
                3. If |cachedPosition|'s + {{GeolocationPosition/timestamp}}'s value is greater than + |cacheTime|, and + |cachedPosition|.{{GeolocationPosition/[[isHighAccuracy]]}} + equals |options|.{{PositionOptions/enableHighAccuracy}}, + set |position| to |cachedPosition|. +
                4. +
                +
              4. +
              5. Otherwise, if |position| is not |cachedPosition|, try to + acquire position data from the underlying system, optionally + taking into consideration the value of + |options|.{{PositionOptions/enableHighAccuracy}} during + acquisition. +
              6. +
              7. If the |timeout| elapses during acquisition, or acquiring + the device's position results in failure: +
                  +
                1. Stop the |timeout|. +
                2. +
                3. Go to dealing with + failures. +
                4. +
                5. Terminate this algorithm. +
                6. +
                +
              8. +
              9. If acquiring the position data form the system succeeds: +
                  +
                1. Set |position| be [=a new `GeolocationPosition`=] + passing |acquisitionTime| and + |options|.{{PositionOptions/enableHighAccuracy}}. +
                2. +
                3. Set [=this=]'s {{Geolocation/[[cachedPosition]]}} to + |position|. +
                4. +
                +
              10. +
              11. Stop the |timeout|. +
              12. +
              13. [=Queue a task=] on the [=geolocation task source=] with + a step that [=invokes=] |successCallback| with |position|. +
              14. +
            +
            +
            + Dealing with failures: +
            +
            +
              +
            • If acquiring a position fails, do one of the following + based on the condition that matches the failure: +
              +
              + User or system denied permission: +
              +
              +

              + [=Call back with error=] passing |errorCallback| and + {{GeolocationPositionError/PERMISSION_DENIED}}. +

              + +
              +
              + Timeout elapsed: +
              +
              + [=Call back with error=] with |errorCallback| and + {{GeolocationPositionError/TIMEOUT}}. +
              +
              + Data acquisition error or any other reason: +
              +
              + [=Call back with error=] passing |errorCallback| and + {{GeolocationPositionError/POSITION_UNAVAILABLE}}. +
              +
              +
            • +
            +
            +
          @@ -975,13 +965,19 @@

          The timeout member denotes the maximum length of time, expressed in milliseconds, before [=acquiring a position=] expires.

          -

          +

          The time spent waiting for the document to become visible and for [=check permission|obtaining permission to use the API=] is not included in the period covered by the {{PositionOptions/timeout}} member. The {{PositionOptions/timeout}} member only applies when [=acquiring a position=] begins.

          +

          @@ -1065,7 +1061,7 @@

          Used by this specification to queue up non-blocking {{PositionCallback}} and {{PositionErrorCallback}} when performing - [=request position|position requests=]. + [=request a position|position requests=].

          @@ -1213,7 +1209,7 @@

          PERMISSION_DENIED (numeric value 1)
          - [=Request position=] failed because the user denied permission to + [=Request a position=] failed because the user denied permission to use the API.
          From 8753a4bce46a33c0ea7cabe83ed72ac7c9b666fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Thu, 27 Jan 2022 23:11:46 +1100 Subject: [PATCH 03/13] stray find and repalce --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 55700dc..ca11058 100644 --- a/index.html +++ b/index.html @@ -441,7 +441,7 @@

          that can govern the usage and access to users' location data.

          - Recipients ought to only request a position information when + Recipients ought to only request position information when necessary, and only use the location information for the task for which it was provided to them. Recipients ought to dispose of location information once that task is completed, unless expressly From 121b09c8843d6da84b465dccc81f24f329a7f635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Fri, 28 Jan 2022 00:02:18 +1100 Subject: [PATCH 04/13] Bring back missing permission policy check --- index.html | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/index.html b/index.html index ca11058..edbd8bb 100644 --- a/index.html +++ b/index.html @@ -441,14 +441,14 @@

          that can govern the usage and access to users' location data.

          - Recipients ought to only request position information when - necessary, and only use the location information for the task for - which it was provided to them. Recipients ought to dispose of - location information once that task is completed, unless expressly - permitted to retain it by the user. Recipients need to also take - measures to protect this information against unauthorized access. If - location information is stored, users need to be allowed to update - and delete this information. + Recipients ought to only request position information when necessary, + and only use the location information for the task for which it was + provided to them. Recipients ought to dispose of location information + once that task is completed, unless expressly permitted to retain it + by the user. Recipients need to also take measures to protect this + information against unauthorized access. If location information is + stored, users need to be allowed to update and delete this + information.

          The recipients of location information need to refrain from @@ -608,7 +608,7 @@

          method steps are:

            -
          1. If the [=current settings object=]'s [=associated `Document`=] is +
          2. If the [=current settings object=]'s [=responsible document=] is not [=Document/fully active=]:
            1. [=Call back with error=] |errorCallback| and @@ -634,7 +634,7 @@

              method steps are:

                -
              1. If the [=current settings object=]'s [=associated `Document`=] is +
              2. If the [=current settings object=]'s [=responsible document=] is not [=Document/fully active=]:
                1. [=Call back with error=] passing |errorCallback| and @@ -684,7 +684,19 @@

                2. Let |watchIDs:List| be [=this=]'s {{Geolocation/[[watchIDs]]}}.
                3. Let |document:Document| be the [=current settings object=]'s - [=associated Document=]. + [=responsible document=]. +
                4. +
                5. If |document| is not [=allowed to use=] the + "geolocation" feature: +
                    +
                  1. [=List/Remove=] |watchId| from |watchIDs|. +
                  2. +
                  3. [=Call back with error=] passing |errorCallback| and + {{GeolocationPositionError/PERMISSION_DENIED}}. +
                  4. +
                  5. Terminate this algorithm. +
                  6. +
                6. If |document:Document|'s [=Document/visibility state=] is "hidden", wait for the following [=page visibility change steps=] to From e0e1172a3843f0f661b2c47079b60c5429141551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Fri, 28 Jan 2022 00:05:39 +1100 Subject: [PATCH 05/13] Few nits, small clarifications --- index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index edbd8bb..c862b01 100644 --- a/index.html +++ b/index.html @@ -678,7 +678,7 @@

                  To request a position, pass a {{PositionCallback}} |successCallback:PositionCallback|, a {{PositionErrorCallback?}} |errorCallback:PositionErrorCallback?|, {{PositionOptions}} - |options:PositionOptions|, and an optional |watchId:long|: + |options:PositionOptions|, and an optional |watchId:unsigned long|:

                  1. Let |watchIDs:List| be [=this=]'s {{Geolocation/[[watchIDs]]}}. @@ -689,7 +689,7 @@

                  2. If |document| is not [=allowed to use=] the "geolocation" feature:
                      -
                    1. [=List/Remove=] |watchId| from |watchIDs|. +
                    2. If passed, [=List/remove=] |watchId| from |watchIDs|.
                    3. [=Call back with error=] passing |errorCallback| and {{GeolocationPositionError/PERMISSION_DENIED}}. @@ -718,7 +718,7 @@

                      "getCurrentPosition_permission_allow.https.html, getCurrentPosition_permission_deny.https.html"> If |permission| is "denied", then:
                        -
                      1. [=List/Remove=] |watchId| from |watchIDs|. +
                      2. If passed, [=list/remove=] |watchId| from |watchIDs|.
                      3. [=Call back with error=] passing |errorCallback| and {{GeolocationPositionError/PERMISSION_DENIED}}. @@ -775,7 +775,7 @@

                        passing {{PositionCallback}} |successCallback:PositionCallback|, a {{PositionErrorCallback?}} |errorCallback:PositionErrorCallback?|, {{PositionOptions}} |options:PositionOptions|, and an optional - |watchId:long|. + |watchId:unsigned long|.

                        1. If |watchId| was passed and [=this=]'s From cbf28f04ca5971413bed89e2fc80e957361530bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Fri, 28 Jan 2022 00:08:47 +1100 Subject: [PATCH 06/13] Fix xrefs to [=environment settings object/responsible document=] --- index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index c862b01..228a56d 100644 --- a/index.html +++ b/index.html @@ -608,8 +608,8 @@

                          method steps are:

                            -
                          1. If the [=current settings object=]'s [=responsible document=] is - not [=Document/fully active=]: +
                          2. If the [=current settings object=]'s [=environment settings + object/responsible document=] is not [=Document/fully active=]:
                            1. [=Call back with error=] |errorCallback| and {{GeolocationPositionError/POSITION_UNAVAILABLE}}. @@ -634,8 +634,8 @@

                              method steps are:

                                -
                              1. If the [=current settings object=]'s [=responsible document=] is - not [=Document/fully active=]: +
                              2. If the [=current settings object=]'s [=environment settings + object/responsible document=] is not [=Document/fully active=]:
                                1. [=Call back with error=] passing |errorCallback| and {{GeolocationPositionError/POSITION_UNAVAILABLE}}. @@ -684,7 +684,7 @@

                                2. Let |watchIDs:List| be [=this=]'s {{Geolocation/[[watchIDs]]}}.
                                3. Let |document:Document| be the [=current settings object=]'s - [=responsible document=]. + [=environment settings object/responsible document=].
                                4. If |document| is not [=allowed to use=] the "geolocation" feature: From bb362855ae6141dd969c8415519d3ef0e2a34b37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Fri, 28 Jan 2022 00:11:25 +1100 Subject: [PATCH 07/13] Be more clear about |watchId| being passed --- index.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 228a56d..a53d601 100644 --- a/index.html +++ b/index.html @@ -689,7 +689,8 @@

                                5. If |document| is not [=allowed to use=] the "geolocation" feature:
                                    -
                                  1. If passed, [=List/remove=] |watchId| from |watchIDs|. +
                                  2. If |watchId| was passed, [=List/remove=] |watchId| from + |watchIDs|.
                                  3. [=Call back with error=] passing |errorCallback| and {{GeolocationPositionError/PERMISSION_DENIED}}. @@ -718,7 +719,8 @@

                                    "getCurrentPosition_permission_allow.https.html, getCurrentPosition_permission_deny.https.html"> If |permission| is "denied", then:
                                      -
                                    1. If passed, [=list/remove=] |watchId| from |watchIDs|. +
                                    2. If |watchId| was passed, [=list/remove=] |watchId| from + |watchIDs|.
                                    3. [=Call back with error=] passing |errorCallback| and {{GeolocationPositionError/PERMISSION_DENIED}}. From 30a592a1be5ae649055ec54c0901a32d22828c2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Fri, 28 Jan 2022 00:15:42 +1100 Subject: [PATCH 08/13] Should wait to acquire a position --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index a53d601..c2ffde1 100644 --- a/index.html +++ b/index.html @@ -760,7 +760,7 @@

                                    4. -
                                    5. Attempt to [=acquire a position=] passing |successCallback|, +
                                    6. Wait to [=acquire a position=] passing |successCallback|, |errorCallback|, |options|, and |watchId|.
                                    From 1b3f29ba9ca828196e4520e12be00b167312d909 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Fri, 28 Jan 2022 00:19:35 +1100 Subject: [PATCH 09/13] nit --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index c2ffde1..7b36abf 100644 --- a/index.html +++ b/index.html @@ -922,7 +922,7 @@

                                    When instructed to call back with error, given an - {{PositionErrorCallback}}`?` |callback:PositionErrorCallback| and an + {{PositionErrorCallback?}} |callback:PositionErrorCallback?| and an {{unsigned short}} |code:unsigned short|:

                                      From 1a773776cd98080d0c4ea29f81ae62e66bac858a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Sat, 29 Jan 2022 01:33:30 +1100 Subject: [PATCH 10/13] Apply suggestions from code review Co-authored-by: Reilly Grant --- index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 7b36abf..dc15657 100644 --- a/index.html +++ b/index.html @@ -496,10 +496,10 @@

                                      The Geolocation API is a [=default powerful feature=].

                                      - When check permission + When checking permission to use the API, a user agent MAY suggest time-based [=permission=] [=permission/lifetimes=], such as "24 hours", "1 week", or choose to - remember the permission [permission/grant=] indefinitely. However, it + remember the permission [=permission/grant=] indefinitely. However, it is RECOMMENDED that a user agent prioritize restricting the [=permission=] [=permission/lifetime=] to a single session: This can be, for example, until the [=environment settings object/realm=] is @@ -804,7 +804,7 @@

                                      1. Stop |timeout|.
                                      2. -
                                      3. Do the user or system denied +
                                      4. Do the user or system denied permission failure case step.
                                      @@ -847,7 +847,7 @@

                                  4. -
                                  5. If acquiring the position data form the system succeeds: +
                                  6. If acquiring the position data from the system succeeds:
                                    1. Set |position| be [=a new `GeolocationPosition`=] passing |acquisitionTime| and @@ -875,7 +875,7 @@

                                    2. If acquiring a position fails, do one of the following based on the condition that matches the failure:
                                      -
                                      +
                                      User or system denied permission:
                                      From a48f308202173e092e46d076954e39828004671b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Sat, 29 Jan 2022 01:34:35 +1100 Subject: [PATCH 11/13] tidy --- index.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index dc15657..adf1b00 100644 --- a/index.html +++ b/index.html @@ -496,13 +496,13 @@

                                      The Geolocation API is a [=default powerful feature=].

                                      - When checking permission - to use the API, a user agent MAY suggest time-based [=permission=] - [=permission/lifetimes=], such as "24 hours", "1 week", or choose to - remember the permission [=permission/grant=] indefinitely. However, it - is RECOMMENDED that a user agent prioritize restricting the - [=permission=] [=permission/lifetime=] to a single session: This can - be, for example, until the [=environment settings object/realm=] is + When checking permission to use the API, a user agent MAY + suggest time-based [=permission=] [=permission/lifetimes=], such as + "24 hours", "1 week", or choose to remember the permission + [=permission/grant=] indefinitely. However, it is RECOMMENDED that a + user agent prioritize restricting the [=permission=] + [=permission/lifetime=] to a single session: This can be, for + example, until the [=environment settings object/realm=] is destroyed, the end-user [=navigates=] away from the [=origin=], or the relevant browser tab is closed.

                                      From 3453a23f696e1f7bd0e528d963b6fbcca5572694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Sat, 29 Jan 2022 01:38:42 +1100 Subject: [PATCH 12/13] fix xref 'check permission' --- index.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index adf1b00..73ce500 100644 --- a/index.html +++ b/index.html @@ -496,13 +496,13 @@

                                      The Geolocation API is a [=default powerful feature=].

                                      - When checking permission to use the API, a user agent MAY - suggest time-based [=permission=] [=permission/lifetimes=], such as - "24 hours", "1 week", or choose to remember the permission - [=permission/grant=] indefinitely. However, it is RECOMMENDED that a - user agent prioritize restricting the [=permission=] - [=permission/lifetime=] to a single session: This can be, for - example, until the [=environment settings object/realm=] is + When checking permission + to use the API, a user agent MAY suggest time-based [=permission=] + [=permission/lifetimes=], such as "24 hours", "1 week", or choose to + remember the permission [=permission/grant=] indefinitely. However, + it is RECOMMENDED that a user agent prioritize restricting the + [=permission=] [=permission/lifetime=] to a single session: This can + be, for example, until the [=environment settings object/realm=] is destroyed, the end-user [=navigates=] away from the [=origin=], or the relevant browser tab is closed.

                                      From e5481f8c11f6e211911c4b21ce187caead9670fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Sat, 29 Jan 2022 11:45:57 +1100 Subject: [PATCH 13/13] Add missing null on PositionErrorCallback --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 73ce500..9a924f9 100644 --- a/index.html +++ b/index.html @@ -604,7 +604,7 @@

                                      The getCurrentPosition(|successCallback:PositionCallback|, - |errorCallback:PositionErrorCallback|, |options:PositionOptions|) + |errorCallback:PositionErrorCallback?|, |options:PositionOptions|) method steps are:

                                        @@ -630,7 +630,7 @@

                                        The watchPosition(|successCallback:PositionCallback|, - |errorCallback:PositionErrorCallback|, |options:PositionOptions|) + |errorCallback:PositionErrorCallback?|, |options:PositionOptions|) method steps are: