The default bug view has changed. See this FAQ.

Align navigator.geolocation with spec

RESOLVED FIXED in mozilla25

Status

()

Core
DOM
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: bz, Assigned: ggp)

Tracking

({dev-doc-complete, site-compat})

Trunk
mozilla25
dev-doc-complete, site-compat
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Per spec, this never returns null, which is totally not what our implementation does when geo.enabled is not set....

Updated

4 years ago
Assignee: nobody → ggoncalves
Shouldn't that be solved by having the properties behind [PrefEnabled] when Navigator is converted to WebIDL?
OS: Mac OS X → All
Hardware: x86 → All
Version: unspecified → Trunk
I think so, yes; I'm just not willing to make that change as part of the navigator webidl conversion, since Doug thinks it's risky.
Depends on: 838146
(Assignee)

Comment 3

4 years ago
I'm not sure I understand the desired behavior here. Should navigator.geolocation never be null, but issue error events for all calls to getCurrentPosition/watchPosition when "geo.enabled" is false?
That's a good question.

The options are either to do that or to have |"geolocation" in navigator| test false if geo.enabled is false and have navigator.geolocation be undefined.  And also have the geolocation interface object disappear when the pref is not set, if we take this approach.
(Assignee)

Comment 5

4 years ago
Created attachment 778682 [details] [diff] [review]
navigator.geolocation should never be null.

Here's my stab at the second option. This causes navigator.geolocation
to be undefined when the pref is false on page load.

However, if the pref is set to false after being true on page load, that
doesn't cause navigator.geolocation to be undefined. Is that a problem?
navigator.getGamepads seems to also behave like that.


Feedback: bzbarsky@mit.edu
(Assignee)

Comment 6

4 years ago
Created attachment 778687 [details] [diff] [review]
navigator.geolocation should never be null.
(Assignee)

Updated

4 years ago
Attachment #778687 - Flags: feedback?(bzbarsky)
(Assignee)

Updated

4 years ago
Attachment #778682 - Attachment is obsolete: true
Comment on attachment 778687 [details] [diff] [review]
navigator.geolocation should never be null.

> Is that a problem?

No.

And looks like Geolocation is [NoInterfaceObject] (why?) so there is no need to condition its interface object on the pref.
Attachment #778687 - Flags: feedback?(bzbarsky) → feedback+
(Assignee)

Comment 8

4 years ago
Comment on attachment 778687 [details] [diff] [review]
navigator.geolocation should never be null.

Doug, I don't know what concerns you had regarding this bug, so please let me know if anything is missing. Seems to work on try: https://tbpl.mozilla.org/?tree=Try&rev=ed06767dda70
Attachment #778687 - Flags: review?(doug.turner)

Updated

4 years ago
Attachment #778687 - Flags: review?(doug.turner) → review+
(In reply to Boris Zbarsky (:bz) from comment #7)
> And looks like Geolocation is [NoInterfaceObject] (why?) so there is no need
> to condition its interface object on the pref.

It is likely a bug in the specification.
(Assignee)

Updated

4 years ago
Keywords: checkin-needed
https://hg.mozilla.org/integration/mozilla-inbound/rev/b54402f21eb8
Flags: in-testsuite+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/b54402f21eb8
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
Keywords: dev-doc-needed
https://developer.mozilla.org/en-US/docs/WebAPI/Using_geolocation
https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/25/Site_Compatibility
Keywords: dev-doc-needed → dev-doc-complete, site-compat
You need to log in before you can comment on or make changes to this bug.