Various other events need timeStamps

REOPENED
Unassigned

Status

()

Core
DOM: Events
REOPENED
12 years ago
5 months ago

People

(Reporter: Martijn Wargers (dead), Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

12 years ago
See url.
I've tested a bit, but those event also have a timeStamp of 0.
They should also have a timestamp, right?

It seems to work when I add this in the code.
event.time = PR_Now();

Is that the right approach?
Should I do that for all the instances I see it in lxr?
PR_Now() is probably the wrong thing (since we don't want time in _microseconds_).  A lot of existing code uses PR_IntervalNow() (which is milliseconds on Unix, but varies on Windows), but some places do PR_Now().

It might be worth deciding what event.timeStamp actually _is_ and then making it consistent.

Also note bug 77992.
Ccing some folks who might be interested in this.
OS: Windows XP → All
Hardware: PC → All
Are you talking about exposing this to webpages, or is this an internal (unscriptable) thing?

Comment 4

12 years ago
(In reply to comment #3)
> Are you talking about exposing this to webpages, or is this an internal
> (unscriptable) thing?
> 

http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html#Events-Event
Event::timeStamp.

The problem is that when an event is dispatched using (for example) nsEvent, 
the time stamp is not usually updated, but the default value 0 is used.

When a nsDOMEvent is created and dispatched, the timestamp is set to PR_Now().

Updated

9 years ago
Assignee: events → nobody
Depends on: 77992
QA Contact: ian → events

Comment 5

3 years ago
A similar search on MXR doesn't find anything: http://mxr.mozilla.org/mozilla-central/search?string=nsevent%20event
Can it be updated or should this bug be closed?
(Reporter)

Updated

5 months ago
Status: NEW → RESOLVED
Last Resolved: 5 months ago
Resolution: --- → WORKSFORME
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
You need to log in before you can comment on or make changes to this bug.