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.
Are you talking about exposing this to webpages, or is this an internal (unscriptable) thing?
(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().
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?
2 months ago