Closed Bug 884921 Opened 7 years ago Closed 7 years ago

Align navigator.geolocation with spec

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla25

People

(Reporter: bzbarsky, Assigned: ggp)

References

Details

(Keywords: dev-doc-complete, site-compat)

Attachments

(1 file, 1 obsolete file)

Per spec, this never returns null, which is totally not what our implementation does when geo.enabled is not set....
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
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.
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
Attachment #778687 - Flags: feedback?(bzbarsky)
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+
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)
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.
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/b54402f21eb8
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.