Closed
Bug 1296125
Opened 9 years ago
Closed 9 years ago
position.timestamp is microseconds in native location providers
Categories
(Core :: DOM: Geolocation, defect, P3)
Core
DOM: Geolocation
Tracking
()
RESOLVED
FIXED
mozilla51
| Tracking | Status | |
|---|---|---|
| firefox51 | --- | fixed |
People
(Reporter: dietrich, Assigned: dougt)
Details
(Keywords: DevAdvocacy)
Attachments
(1 file, 1 obsolete file)
|
3.58 KB,
patch
|
kanru
:
review+
|
Details | Diff | Splinter Review |
<script>
navigator.geolocation.watchPosition(function(position) {
document.body.innerHTML = 'timestamp: ' + position.timestamp
+ ', new Date(timestamp): ' + new Date(position.timestamp);
});
</script>
MDN says should be milliseconds:
https://developer.mozilla.org/en-US/docs/Web/API/Position/timestamp
Spec says should be milliseconds:
https://www.w3.org/TR/geolocation-API/#position
Fennec implements as milliseconds.
(If it were up to me, it'd be implemented in millivanilliseconds.)
| Reporter | ||
Updated•9 years ago
|
Keywords: DevAdvocacy
Updated•9 years ago
|
Priority: -- → P3
| Reporter | ||
Comment 1•9 years ago
|
||
Confirmed this is only on Mac. Linux and Windows are unaffected.
| Assignee | ||
Comment 2•9 years ago
|
||
Thanks Dietrich.
Basically Mac (nightly?) uses the native location provider. Most platforms use the network based on (GLS/MLS).
The bug on the mac is here:
https://dxr.mozilla.org/mozilla-central/source/dom/system/mac/CoreLocationLocationProvider.mm?q=CoreLocationLocationProvider.mm&redirect_type=direct#103
PR_Now() is defined in microseconds:
https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_Now
I think we should just replace this PR_Now() with PR_IntervalToMicroseconds(PR_IntervalNow())
We should audit the other places we use PR_Now(). For example, windows does:
https://dxr.mozilla.org/mozilla-central/source/dom/system/windows/WindowsLocationProvider.cpp#176
| Assignee | ||
Updated•9 years ago
|
Summary: position.timestamp is microseconds on desktop (mac), should be milliseconds → position.timestamp is microseconds in native location providers
| Assignee | ||
Comment 3•9 years ago
|
||
Attachment #8784113 -
Flags: review?(kchen)
| Assignee | ||
Updated•9 years ago
|
Attachment #8784113 -
Attachment is obsolete: true
Attachment #8784113 -
Attachment is patch: false
Attachment #8784113 -
Flags: review?(kchen)
| Assignee | ||
Comment 4•9 years ago
|
||
Assignee: nobody → doug.turner
Attachment #8784115 -
Flags: review?(kchen)
Comment 5•9 years ago
|
||
Comment on attachment 8784115 [details] [diff] [review]
bug_1296125_use_milliseconds
Review of attachment 8784115 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM
Attachment #8784115 -
Flags: review?(kchen) → review+
| Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b4a425b5c3ae
Geolocation timestamp sometimes uses microseconds instead of milliseconds. r=kchen
Keywords: checkin-needed
Comment 7•9 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox51:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in
before you can comment on or make changes to this bug.
Description
•