Conversation
|
For readability as you iterate on this proposal it's okay for this PR to directly change the specification text however to land this change the changes need to be enclosed in the correct candidate additions/corrections/deletions syntax. |
|
@reillyeon if it's ok, let's move this to CR first (i.e., let's not waste time with the ins/dels). We are close to publishing as CR again. |
99d9b03 to
3fa8869
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for approximate location positioning to the Geolocation API specification. It introduces a privacy-preserving alternative to precise location sharing, allowing applications to request coarse-grained location data when high accuracy is not needed.
Key changes:
- Introduces
accuracyModeoption with "precise" (default) and "approximate" values - Adds new "geolocation-approximate" permission alongside existing "geolocation" permission
- Implements separate caching for precise and approximate positions
- Updates permission request flows to allow users to choose between precise and approximate location sharing
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3fa8869 to
8658f5a
Compare
2354ca8 to
d3a4d47
Compare
antosart
left a comment
There was a problem hiding this comment.
A few comments wrt the permission handling.
d3a4d47 to
b0d0589
Compare
90c6bf0 to
c9f1bc3
Compare
alvinjiooo
left a comment
There was a problem hiding this comment.
I have new permission policy part dropped. PTAL and thanks.
|
Updated the PR template at the top of the PR... we need to file bugs still, etc. |
Should we split out the "Candidate addition" removal stuff in a separate CL? It would make this one a little easier to parse :) |
c9f1bc3 to
491b324
Compare
It sounds like #181 will be landed soon once the status change happened. I will rebased this PR again once that one is landed. |
491b324 to
79598a3
Compare
79598a3 to
75126d4
Compare
|
Hi @marcoscaceres and @antosart , |
| as well as user input. The API itself is agnostic of the underlying | ||
| location information sources, and no guarantee is given that the API | ||
| returns the device's actual location. | ||
| <dfn>location information source</dfn>s, and no guarantee is given that |
There was a problem hiding this comment.
(nit) I believe you can just include the s (<dfn>location information sources</dfn>) since autolinking shouldn't care about plurals. That makes the spec look nicer.
(I also think this dfn is kind of weird since it's not defining anything, but I'm not sure about that.)
There was a problem hiding this comment.
Ack, I will remove the dfn for location information source. I think our points here is to define precise position and approximate position. I will update this in next patch.
| [=permission/"prompt"=], set |status|'s to | ||
| [=permission/"prompt"=]. Otherwise, set |status|'s | ||
| {{PermissionStatus/state}} to |appxorimatePermissionState|. | ||
| </li> |
There was a problem hiding this comment.
I propose to change as following:
<li>If |approximatePermissionState| is [=permission/"granted"=]
and |permissionDesc|'s [=permission state=] is
[=permission/"denied"=], set |status|'s to
[=permission/"granted"=]. Otherwise, set |status|'s
{{PermissionStatus/state}} to |permissionDesc|'s [=permission state=].
</li>
which makes it more clear that there is only one exception to returning |permissionDesc|'s [=permission state=].
There was a problem hiding this comment.
I actually have question for the new proposal.
For what we have right now, it only provide one exception when:
approximate: grant
precise: prompt
final permission state: prompt
Everything else determined by approximate's permission state.
But for new proposal, when:
approximate: denied
-> final permission state is determined by precise's state, which can be anything from {denied, granted, prompt}. But I think if approximate's state is defined the final state should be denied too.
Can you please clarify if I missed anything?
| <code><dfn class="permission">"geolocation-approximate"</dfn></code> | ||
| (for approximate location). | ||
| </p> | ||
| <p> |
There was a problem hiding this comment.
I think we are not writing anywhere that there are dependencies between the values of the permissions, right? The Permissions spec doesn't really have support for that, but it doesn't specify how permission state can be changed (e.g. in site settings) either. So I believe we can add a sentence here, explaining that "geolocation" should always be stricter than "geolocation-approximate". We can even include the full list of the allowed states. We can also explain that vendors should always ensure that the states are coherent, so when changing one of the two values for "geolocation" or "geolocation-approximate" they might have to change the value of the other one, too.
I think that's important because the algorithms below assume that we are always in one of the allowed states.
There was a problem hiding this comment.
That sounds good, I will add a new paragraph explicitly defining the directional relationship: granting precise location implies granting approximate location, and denying approximate location implies denying precise location. I'll include the full list of valid state combinations and explicitly require implementers to maintain this coherence when values change.
<p>
There is a strict dependency between the [=permission state=]s of
<code>"geolocation"</code> and <code>"geolocation-approximate"</code>.
Specifically, granting precise location implies granting approximate
location, and denying approximate location implies denying precise
location. This results in the following allowed combinations of states:
</p>
<ul>
<li>Both are [=permission/"granted"=].</li>
<li>Both are [=permission/"prompt"=].</li>
<li>Both are [=permission/"denied"=].</li>
<li><code>"geolocation-approximate"</code> is [=permission/"granted"=] and <code>"geolocation"</code> is [=permission/"prompt"=].</li>
<li><code>"geolocation-approximate"</code> is [=permission/"granted"=] and <code>"geolocation"</code> is [=permission/"denied"=].</li>
<li><code>"geolocation-approximate"</code> is [=permission/"prompt"=] and <code>"geolocation"</code> is [=permission/"denied"=].</li>
</ul>
<p>
Implementers MUST ensure that these states remain coherent. For
example, if a user changes the [=permission state=] of
<code>"geolocation-approximate"</code> to [=permission/"denied"=] via
site settings, the user agent MUST automatically update
<code>"geolocation"</code> to [=permission/"denied"=] as well.
Similarly, if <code>"geolocation"</code> is changed to
[=permission/"granted"=], <code>"geolocation-approximate"</code> MUST
also become [=permission/"granted"=].
</p>Does this make sense to you?
Closes #182
The following tasks have been completed:
Implementation commitment (and no objections):
Documentation (new feature):
For documentation, either create an issue or pull request in MDN's Content repo - providing as much information as you can. PR is prefered.
This commit introduces the ability for users and developers to request a less precise, privacy-preserving "approximate" location.
Key changes include:
Closes #182
Approximate Geolocation explainer
Preview | Diff