Let |watchTasks:Set| be [=this=]'s
{{Geolocation/[[watchTasks]]}}.
-
Acquire a watch id.
-
-
If |previous id| was provided, let |watchId:long| be
- |previous id|; Otherwise, let |watchId:long| be an
- [=implementation-defined=] {{long}} that is greater than or equal
- to zero.
-
-
[=Set/Append=] |watchId| to |watchTasks|.
-
-
Return |watchId| and continue [=in parallel=].
-
-
+
If |previous id| was provided, let |watchId:long| be |previous
+ id|; Otherwise, let |watchId:long| be an [=implementation-defined=]
+ {{long}} that is greater than or equal to zero.
[=Call back with error=] |errorCallback| and
- {{GeolocationPositionError/PERMISSION_DENIED}}.
-
-
[=List/Remove=] |watchId| from |watchTasks|.
-
-
Terminate this algorithm.
-
-
-
-
+
[=Set/Append=] |watchId| to |watchTasks|.
-
Wait for document to become
- visible.
-
-
Let |document:Document| be the [=current settings object=]'s
- [=associated Document=].
-
-
If |document:Document| is [=Document/hidden=], wait for the
- |document| to become [=Document/visible=].
-
-
-
-
- [=Check permission=] passing |errorCallback|. If the check return
- failure:
-
-
[=List/Remove=] |watchId| from |watchTasks|.
-
-
Terminate this algorithm.
-
-
+
Return |watchId|.
-
- Acquire position.
+
Run these steps [=in parallel=]:
-
Let |acquisitionTime:DOMTimeStamp| be a new {{DOMTimeStamp}}
- that represents now in milliseconds, using 01 January, 1970 UTC
- as the epoch.
-
-
If |options|.{{PositionOptions/maximumAge}} is greater than
- 0, and |cachedPosition| is not null:
+
Do security check.
-
Let |cachedPosition:GeolocationPosition| be [=this=]'s
- {{Geolocation/[[cachedPosition]]}}.
-
-
Let |cacheTime:long| be |acquisitionTime| minus the value
- of |options|.{{PositionOptions/maximumAge}} member.
-
-
If |cachedPosition|'s {{GeolocationPosition/timestamp}}'s
- value is greater than |cacheTime|, and
- |cachedPosition|.{{GeolocationPosition/[[isHighAccuracy]]}}
- equals |options|.{{PositionOptions/enableHighAccuracy}}:
+
Let |timeout:Task| be a new timed [=task=] that runs in
- |options|.{{PositionOptions/timeout}} milliseconds after
- |acquisitionTime|, which performs the following sub-steps:
-
+
Wait for document to become
+ visible.
-
If the entry for |timerId| in the [=list of active
- timers=] has been cleared, then abort these steps.
+
Let |document:Document| be the [=current settings
+ object=]'s [=associated Document=].
-
[=Call back with error=] with |errorCallback| and
- {{GeolocationPositionError/TIMEOUT}}.
+
If |document:Document| is [=Document/hidden=], wait for
+ the |document| to become [=Document/visible=].
-
Let |timerId:long| be an [=implementation-defined=]
- identifier that represents |timeout|.
-
-
Add |timerId| to the [=list of active timers=].
+
+ [=Check permission=] passing |errorCallback|. If the check
+ returns failure:
+
+
[=List/Remove=] |watchId| from |watchTasks|.
+
+
Terminate this algorithm.
+
+
-
Try to acquire the device's position, optionally taking into
- consideration the value of
- |options|.{{PositionOptions/enableHighAccuracy}}:
+
+ Acquire
+ position.
-
If acquiring a position succeeds:
+
Let |acquisitionTime:DOMTimeStamp| be a new
+ {{DOMTimeStamp}} that represents now in milliseconds, using
+ 01 January, 1970 UTC as the epoch.
+
+
If |options|.{{PositionOptions/maximumAge}} is greater
+ than 0, and |cachedPosition| is not null:
-
Let |position:GeolocationPosition| be [=a new
- `GeolocationPosition`=] passing |acquisitionTime| and
- |options|.{{PositionOptions/enableHighAccuracy}}.
+
Let |cachedPosition:GeolocationPosition| be
+ [=this=]'s {{Geolocation/[[cachedPosition]]}}.
-
Set [=this=]'s {{Geolocation/[[cachedPosition]]}} to
- |position|.
+
Let |cacheTime:long| be |acquisitionTime| minus the
+ value of |options|.{{PositionOptions/maximumAge}} member.
+
+
If |cachedPosition|'s
+ {{GeolocationPosition/timestamp}}'s value is greater than
+ |cacheTime|, and
+ |cachedPosition|.{{GeolocationPosition/[[isHighAccuracy]]}}
+ equals |options|.{{PositionOptions/enableHighAccuracy}}:
+
+
[=Queue a microtask=] with a step that
+ [=invokes=] |successCallback| with |cachedPosition|.
+
Let |timeout:Task| be a new timed [=task=] that runs in
+ |options|.{{PositionOptions/timeout}} milliseconds after
+ |acquisitionTime|, which performs the following sub-steps:
+
+
+
If the entry for |timerId| in the [=list of active
+ timers=] has been cleared, then abort these steps.
-
[=Queue a microtask=] to [=invoke=] |successCallback|
- with |position|.
+
[=Call back with error=] with |errorCallback| and
+ {{GeolocationPositionError/TIMEOUT}}.
-
If acquiring a position fails:
+
Let |timerId:long| be an [=implementation-defined=]
+ identifier that represents |timeout|.
+
+
Add |timerId| to the [=list of active timers=].
+
+
Try to acquire the device's position, optionally taking
+ into consideration the value of
+ |options|.{{PositionOptions/enableHighAccuracy}}:
-
[=Call back with error=] passing |errorCallback| and
- {{GeolocationPositionError/POSITION_UNAVAILABLE}}.
+
If acquiring a position succeeds:
+
+
Let |position:GeolocationPosition| be [=a new
+ `GeolocationPosition`=] passing |acquisitionTime| and
+ |options|.{{PositionOptions/enableHighAccuracy}}.
+
+
Set [=this=]'s {{Geolocation/[[cachedPosition]]}}
+ to |position|.
+
+
[=Queue a microtask=] with a step that
+ [=invokes=] |successCallback| with |position|.
+
+
+
+
If acquiring a position fails:
+
+
[=Call back with error=] passing |errorCallback|
+ and
+ {{GeolocationPositionError/POSITION_UNAVAILABLE}}.
+
+
+
Clear |timerId| from the [=list of active timers=].
+
-
Clear |timerId| from the [=list of active timers=].
-
-
-
-
- Determine repetition.
-
-
If |repeats| is false:
+
+ Determine repetition.
-
[=List/Remove=] |watchId| from |watchTasks|.
-
-
Terminate this algorithm.
+
If |repeats| is false:
+
+
[=List/Remove=] |watchId| from |watchTasks|.
+
+
Terminate this algorithm.
+
+
-
-
-
Wait for a significant change of geographic position. What
- constitutes a significant change of geographic position is left to
- the implementation. A user agents MAY impose a rate limit on the
- frequency position changes.
-
-
If |watchTasks| [=list/contain|contains=] |watchId|, then:
-
-
Wait for a significant change of geographic position. What
+ constitutes a significant change of geographic position is left
+ to the implementation. A user agents MAY impose a rate limit on
+ the frequency position changes.
+
+
If |watchTasks| [=list/contain|contains=] |watchId|, then:
+
+
|successCallback:PositionCallback|, a {{PositionErrorCallback}}`?`
|errorCallback:PositionErrorCallback|, {{PositionOptions}}
|options:PositionOptions|, a {{boolean}} |repeats:boolean|, and
- optionally (and only if |repeats| is true) a |previous id:long|.
+ optionally (and only if |repeats| is true) a |previousId:long|.
Let |watchTasks:Set| be [=this=]'s
{{Geolocation/[[watchTasks]]}}.
-
If |previous id| was provided, let |watchId:long| be |previous
- id|; Otherwise, let |watchId:long| be an [=implementation-defined=]
+
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.
Set [=this=]'s {{Geolocation/[[cachedPosition]]}}
to |position|.
-
[=Queue a microtask=] with a step that
- [=invokes=] |successCallback| with |position|.
+
[=Queue a task=] on the [=geolocation task
+ source=] with a step that [=invokes=]
+ |successCallback| with |position|.
@@ -806,8 +808,8 @@
{{GeolocationPositionError}} instance whose
{{GeolocationPositionError/code}} attribute is initialized to |code|.
-
[=Queue a microtask=] with a step that [=invokes=] |callback| with
- |error|.
+
[=Queue a task=] on the [=geolocation task source=] with a step
+ that [=invokes=] |callback| with |error|.
@@ -929,6 +931,24 @@
+
+
+ Task sources
+
+
+ The following [=task source=] is defined by this specifications.
+
+
+
+ The geolocation task source
+
+
+ Used by this specification to queue up non-blocking
+ {{PositionCallback}} and {{PositionErrorCallback}} when performing
+ [=position requests=].
+
+
+
From 950603c41be7b49aff7450740470f94099765fa6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcos=20C=C3=A1ceres?=
Date: Thu, 10 Jun 2021 22:42:51 +1000
Subject: [PATCH 7/9] Fixup alias request position
---
index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/index.html b/index.html
index 10e910a..4d819c5 100644
--- a/index.html
+++ b/index.html
@@ -945,7 +945,7 @@
Used by this specification to queue up non-blocking
{{PositionCallback}} and {{PositionErrorCallback}} when performing
- [=position requests=].
+ [=request position|position requests=].
Wait for a significant change of geographic position. What
constitutes a significant change of geographic position is left
- to the implementation. A user agents MAY impose a rate limit on
+ to the implementation. User agents MAY impose a rate limit on
the frequency position changes.