Closed
Bug 590030
Opened 14 years ago
Closed 14 years ago
Both success and error geolocation callbacks can be called
Categories
(Core :: DOM: Geolocation, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jdm, Assigned: jdm)
Details
Attachments
(1 file)
1.65 KB,
patch
|
dougt
:
review+
benjamin
:
approval2.0+
|
Details | Diff | Splinter Review |
Consider a simple testcase: navigator.geolocation.getCurrentPosition(function(p) alert("woo!"), function(p) alert("boo!"), {timeout:5, maxAge:1}); When using the wifi location provider, this will cause both callbacks to be executed when the request is allowed. First the error will fire due to the timeout, but only after the geolocation retrieval has been initiated. The alert spins the event loop, which happens to kick off the wifi monitor which is a sync proxy. This triggers a geolocation update, so the success callback is triggered.
Assignee | ||
Comment 1•14 years ago
|
||
The easiest fix here is to not trigger the error callbacks until we've removed the request from the list of pending ones that the geolocator can update.
Assignee | ||
Comment 2•14 years ago
|
||
Assignee: nobody → josh
Attachment #468616 -
Flags: review?(doug.turner)
Updated•14 years ago
|
Attachment #468616 -
Flags: review?(doug.turner) → review+
Updated•14 years ago
|
Attachment #468616 -
Flags: approval2.0?
Still needs approval.
Keywords: checkin-needed
Assignee | ||
Comment 5•14 years ago
|
||
This patch has bitrotted a bit, for the record.
OS: Linux → Windows CE
Updated•14 years ago
|
Attachment #468616 -
Flags: approval2.0? → approval2.0+
Assignee | ||
Comment 6•14 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/9fb7937e306d
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•