#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: |
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 (10)
comment:1 Changed 12 years ago by
Component: | unfiled → core |
---|
comment:2 Changed 12 years ago by
comment:3 Changed 12 years ago by
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
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.
comment:5 Changed 12 years ago by
Relevant discussion here too : http://forum.jquery.com/topic/fix-is-slow
comment:6 Changed 12 years ago by
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
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:9 Changed 11 years ago by
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
@dilvie, give it a try on all our supported browsers and I think you'll get your answer.
Boaz Sender provided an example of this, with which i reduced to this fiddle:
http://jsfiddle.net/rwaldron/65Zjp/