Last Comment Bug 323039 - Various other events need timeStamps
: Various other events need timeStamps
Status: NEW
:
Product: Core
Classification: Components
Component: DOM: Events (show other bugs)
: Trunk
: All All
: -- normal with 3 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
http://lxr.mozilla.org/seamonkey/sear...
Depends on: 77992
Blocks:
  Show dependency treegraph
 
Reported: 2006-01-11 06:24 PST by Martijn Wargers [:mwargers] (gone per 2016-05-31 :-( )
Modified: 2014-10-03 16:44 PDT (History)
10 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description Martijn Wargers [:mwargers] (gone per 2016-05-31 :-( ) 2006-01-11 06:24:28 PST
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?
Comment 1 Boris Zbarsky [:bz] 2006-01-11 09:18:07 PST
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.
Comment 2 Boris Zbarsky [:bz] 2006-01-11 09:19:37 PST
Ccing some folks who might be interested in this.
Comment 3 Jonas Sicking (:sicking) 2006-01-11 11:49:54 PST
Are you talking about exposing this to webpages, or is this an internal (unscriptable) thing?
Comment 4 Olli Pettay [:smaug] 2006-01-11 12:06:42 PST
(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().
Comment 5 Nickolay_Ponomarev 2014-10-03 16:44:14 PDT
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?

Note You need to log in before you can comment on or make changes to this bug.