Bug Tracker

Ticket #7808 (closed bug: wontfix)

Opened 4 years ago

Last modified 2 years ago

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:1 Changed 4 years ago by rwaldron

  • Component changed from unfiled to core

comment:2 Changed 4 years ago by rwaldron

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

 http://jsfiddle.net/rwaldron/65Zjp/

comment:3 Changed 4 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 4 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 4 years ago by iliakan (previous) (diff)

comment:5 Changed 4 years ago by paul.irish

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

comment:6 Changed 4 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 4 years ago by rwaldron

  • Status changed from new to closed
  • Resolution set to wontfix

comment:8 Changed 2 years ago by rwaldron

#11681 is a duplicate of this ticket.

comment:9 Changed 2 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 2 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.