Ticket #7808 (closed bug: wontfix)
META: Investigate Event Object Creation
| Reported by: | rwaldron | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | 1.6 |
| Component: | core | Version: | 1.4.4 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
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
comment:2 Changed 3 years ago by rwaldron
Boaz Sender provided an example of this, with which i reduced to this fiddle:
comment:3 Changed 3 years ago by rwaldron
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 3 years ago by iliakan
Go http://jsfiddle.net/x34BM/1/ to test the performance. For me the difference is 1.5x - 2x. Not as large as it was for FF in the thread though.
comment:5 Changed 3 years ago by paul.irish
Relevant discussion here too : http://forum.jquery.com/topic/fix-is-slow
comment:6 Changed 3 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 3 years ago by rwaldron
- Status changed from new to closed
- Resolution set to wontfix
comment:9 Changed 14 months 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 14 months ago by dmethvin
@dilvie, give it a try on all our supported browsers and I think you'll get your answer.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
