W3C home > Mailing lists > Public > public-geolocation@w3.org > December 2021

Re: [geolocation-api] List of active times is gone (#113)

From: Domenic Denicola via GitHub <sysbot+gh@w3.org>
Date: Wed, 01 Dec 2021 21:03:47 +0000
To: public-geolocation@w3.org
Message-ID: <issue_comment.created-984052365-1638392625-sysbot+gh@w3.org>
Oh wow, fascinating! I'm glad we changed that to bring this up... as it is written currently, `clearTimeout()` would be able to cancel geolocation!

(Or maybe not, since step 5.5.5 adds it, and then synchronously step 5.5.7 removes it, so it actually never used the list of active timers?)

Deciding whether you want to use "run steps after a timeout", versus just doing the waiting yourself, depends on whether you want the following characteristics:

- The timeout is suspended while the page is in bfcache or while the worker is suspended
- The timeout is allowed implementation-defined fudges, usually to align with CPU wakeups (e.g. on battery)
- The timeout must extend idle deadline computation, i.e. requestIdleCallback()
- The timeouts are ordered, e.g. if two timeouts with the same millisecond value started at the same time must run in order

If you want all of those characteristics, then "run steps after a timeout" is for you. Otherwise, you'd want to manually wait, which is pretty simple: just have some in parallel steps "1. Wait for X milliseconds 2. Do the thing."

-- 
GitHub Notification of comment by domenic
Please view or discuss this issue at https://github.com/w3c/geolocation-api/issues/113#issuecomment-984052365 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 1 December 2021 21:03:49 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 1 December 2021 21:03:50 UTC