Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#7808 closed bug (wontfix)

META: Investigate Event Object Creation

Reported by: Rick Waldron Owned by:
Priority: undecided Milestone: 1.6
Component: core Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:


Currently, if I want to access a special type of event property, such as the dataTransfer property (exists when a file is dropped onto an element that has the "drop" event bound to it), I must look in the event.originalEvent object, otherwise specify its existence with $.event.props.push('dataTransfer');.

This ticket should exist merely for discussion pertaining to the reasons why all properties of the host event object aren't copied to the new event object. I'm sure there might be a perfectly reasonable explanation, so allow this ticket to be a place to clarify.

Change History (10)

comment:1 Changed 12 years ago by Rick Waldron

Component: unfiledcore

comment:2 Changed 12 years ago by Rick Waldron

Boaz Sender provided an example of this, with which i reduced to this fiddle:


comment:3 Changed 12 years ago by Rick Waldron

Previous discussion about this issue can be found here: #1871 and here http://groups.google.com/group/jquery-dev/browse_thread/thread/cc768c85d5514098

Thanks to iliakan for tracking these down

comment:4 Changed 12 years ago by iliakan

Go http://jsfiddle.net/x34BM/2/ to test the performance. For me the difference is 1.5x - 2x. Not as large as it was for FF in the thread though.

Last edited 12 years ago by iliakan (previous) (diff)

comment:5 Changed 12 years ago by paul.irish

Relevant discussion here too : http://forum.jquery.com/topic/fix-is-slow

comment:6 Changed 12 years ago by dmethvin

Paul beat me to it ....

Normalizing the event data is expensive, so we want to touch/copy/normalize as little as possible. We had lots of discussion about the problem there.

Maybe we can resurrect Mike Helgeson's solution for 1.5? It won't help IE but might be worth it for the others.

comment:7 Changed 12 years ago by Rick Waldron

Resolution: wontfix
Status: newclosed

comment:8 Changed 11 years ago by Rick Waldron

#11681 is a duplicate of this ticket.

comment:9 Changed 11 years ago by dilvie@…

Why can't the originalEvent be the prototype for the jQuery event? It seems like that would solve the performance issue, and provide convenient access to event properties.

comment:10 Changed 11 years ago by dmethvin

@dilvie, give it a try on all our supported browsers and I think you'll get your answer.

Note: See TracTickets for help on using tickets.