Skip to main content

Bug Tracker

Side navigation

#8789 closed enhancement (fixed)

Opened April 06, 2011 07:16PM UTC

Closed September 26, 2011 05:40PM UTC

Meta: Event Property Hooks

Reported by: rwaldron Owned by: rwaldron
Priority: blocker Milestone: 1.7
Component: event Version: 1.5.2
Keywords: Cc:
Blocked by: Blocking:
Description

Implement the ability to specify properties of event.originalEvent to be moved over to event.* for specific event types, without the performance sacrifices of copying all event.originalEvent properties or adding to the globally used jQuery.event.props list

Will be particularly useful for newer events introduced by HTML5 JavaScript APIs that have special properties that are ignored by jQuery.event.fix() when it copies the jQuery.event.props array.

Ex.

Drag/Drop API has "dataTranser", touch event props, messaging event props, Custom data properties

Ultimately, this will allow end devs to write less code and we can stop recommending the extension of jQuery.event.props

Attachments (0)
Change History (20)

Changed April 06, 2011 07:18PM UTC by rwaldron comment:1

description: Implement the ability to specify properties of event.originalEvent to be moved over to event.* for specific event types, without the performance sacrifices of copying all event.originalEvent properties or adding to the globally used jQuery.event.props list \ \ Will be particularly useful for newer events introduced by HTML5 JavaScript APIs that have special properties that are ignored by jQuery.event.fix() when it copies the jQuery.event.props array. \ \ Ex. \ \ Drag/Drop API has "dataTranser", touch event props, messaging event props. \ \ Ultimately, this will allow end devs to write less code and we can stop recommending the extension of jQuery.event.propsImplement the ability to specify properties of event.originalEvent to be moved over to event.* for specific event types, without the performance sacrifices of copying all event.originalEvent properties or adding to the globally used jQuery.event.props list \ \ Will be particularly useful for newer events introduced by HTML5 JavaScript APIs that have special properties that are ignored by jQuery.event.fix() when it copies the jQuery.event.props array. \ \ Ex. \ \ Drag/Drop API has "dataTranser", touch event props, messaging event props, Custom data properties \ \ Ultimately, this will allow end devs to write less code and we can stop recommending the extension of jQuery.event.props

Changed April 06, 2011 07:18PM UTC by rwaldron comment:2

component: unfiledevent
milestone: 1.next1.6
owner: → rwaldron
priority: undecidedlow
status: newassigned

Changed April 06, 2011 07:40PM UTC by rwaldron comment:3

Can be stored as simply as shown here http://jsfiddle.net/rwaldron/JxdNj/

Changed April 07, 2011 09:39PM UTC by dmethvin comment:4

Ticket #6942 is another example of when this could be useful. Right now we run all events through the same jQuery.event.fix paths regardless of event type, which is probably causing performance issues in cases where event frequency is high such as mousemove.

Changed April 17, 2011 12:45AM UTC by john comment:5

milestone: 1.61.next
owner: rwaldron

Let's try to get this in 1.7.

Changed May 22, 2011 07:27PM UTC by john comment:6

keywords: → 1.7-discuss

Nominating ticket for 1.7 discussion.

Changed May 22, 2011 09:13PM UTC by rwaldron comment:7

description: Implement the ability to specify properties of event.originalEvent to be moved over to event.* for specific event types, without the performance sacrifices of copying all event.originalEvent properties or adding to the globally used jQuery.event.props list \ \ Will be particularly useful for newer events introduced by HTML5 JavaScript APIs that have special properties that are ignored by jQuery.event.fix() when it copies the jQuery.event.props array. \ \ Ex. \ \ Drag/Drop API has "dataTranser", touch event props, messaging event props, Custom data properties \ \ Ultimately, this will allow end devs to write less code and we can stop recommending the extension of jQuery.event.propsImplement the ability to specify properties of event.originalEvent to be moved over to event.* for specific event types, without the performance sacrifices of copying all event.originalEvent properties or adding to the globally used jQuery.event.props list \ \ Will be particularly useful for newer events introduced by HTML5 JavaScript APIs that have special properties that are ignored by jQuery.event.fix() when it copies the jQuery.event.props array.\ \ Ex.\ \ Drag/Drop API has "dataTranser", touch event props, messaging event props, Custom data properties\ \ Ultimately, this will allow end devs to write less code and we can stop recommending the extension of jQuery.event.props

+1,

Changed May 23, 2011 12:36AM UTC by jaubourg comment:8

+1,

Changed May 23, 2011 04:26AM UTC by timmywil comment:9

+1,

Changed May 24, 2011 09:25PM UTC by dmethvin comment:10

description: Implement the ability to specify properties of event.originalEvent to be moved over to event.* for specific event types, without the performance sacrifices of copying all event.originalEvent properties or adding to the globally used jQuery.event.props list \ \ Will be particularly useful for newer events introduced by HTML5 JavaScript APIs that have special properties that are ignored by jQuery.event.fix() when it copies the jQuery.event.props array.\ \ Ex.\ \ Drag/Drop API has "dataTranser", touch event props, messaging event props, Custom data properties\ \ Ultimately, this will allow end devs to write less code and we can stop recommending the extension of jQuery.event.propsImplement the ability to specify properties of event.originalEvent to be moved over to event.* for specific event types, without the performance sacrifices of copying all event.originalEvent properties or adding to the globally used jQuery.event.props list \ \ Will be particularly useful for newer events introduced by HTML5 JavaScript APIs that have special properties that are ignored by jQuery.event.fix() when it copies the jQuery.event.props array. \ \ Ex. \ \ Drag/Drop API has "dataTranser", touch event props, messaging event props, Custom data properties \ \ Ultimately, this will allow end devs to write less code and we can stop recommending the extension of jQuery.event.props

+1, I like the concept but am concerned about size issues and the temptation to define every property for every event type. Worth an exploratory implementation though.

Changed June 03, 2011 01:51PM UTC by john comment:11

description: Implement the ability to specify properties of event.originalEvent to be moved over to event.* for specific event types, without the performance sacrifices of copying all event.originalEvent properties or adding to the globally used jQuery.event.props list \ \ Will be particularly useful for newer events introduced by HTML5 JavaScript APIs that have special properties that are ignored by jQuery.event.fix() when it copies the jQuery.event.props array. \ \ Ex. \ \ Drag/Drop API has "dataTranser", touch event props, messaging event props, Custom data properties \ \ Ultimately, this will allow end devs to write less code and we can stop recommending the extension of jQuery.event.propsImplement the ability to specify properties of event.originalEvent to be moved over to event.* for specific event types, without the performance sacrifices of copying all event.originalEvent properties or adding to the globally used jQuery.event.props list \ \ Will be particularly useful for newer events introduced by HTML5 JavaScript APIs that have special properties that are ignored by jQuery.event.fix() when it copies the jQuery.event.props array.\ \ Ex.\ \ Drag/Drop API has "dataTranser", touch event props, messaging event props, Custom data properties\ \ Ultimately, this will allow end devs to write less code and we can stop recommending the extension of jQuery.event.props

+1, Yes, absolutely yes.

Changed June 03, 2011 02:31PM UTC by rwaldron comment:12

description: Implement the ability to specify properties of event.originalEvent to be moved over to event.* for specific event types, without the performance sacrifices of copying all event.originalEvent properties or adding to the globally used jQuery.event.props list \ \ Will be particularly useful for newer events introduced by HTML5 JavaScript APIs that have special properties that are ignored by jQuery.event.fix() when it copies the jQuery.event.props array.\ \ Ex.\ \ Drag/Drop API has "dataTranser", touch event props, messaging event props, Custom data properties\ \ Ultimately, this will allow end devs to write less code and we can stop recommending the extension of jQuery.event.propsImplement the ability to specify properties of event.originalEvent to be moved over to event.* for specific event types, without the performance sacrifices of copying all event.originalEvent properties or adding to the globally used jQuery.event.props list \ \ Will be particularly useful for newer events introduced by HTML5 JavaScript APIs that have special properties that are ignored by jQuery.event.fix() when it copies the jQuery.event.props array. \ \ Ex. \ \ Drag/Drop API has "dataTranser", touch event props, messaging event props, Custom data properties \ \ Ultimately, this will allow end devs to write less code and we can stop recommending the extension of jQuery.event.props

Considering the support for this proposal so far, I'm going to begin drafting tests towards a base implementation

Changed June 03, 2011 03:58PM UTC by scottgonzalez comment:13

description: Implement the ability to specify properties of event.originalEvent to be moved over to event.* for specific event types, without the performance sacrifices of copying all event.originalEvent properties or adding to the globally used jQuery.event.props list \ \ Will be particularly useful for newer events introduced by HTML5 JavaScript APIs that have special properties that are ignored by jQuery.event.fix() when it copies the jQuery.event.props array. \ \ Ex. \ \ Drag/Drop API has "dataTranser", touch event props, messaging event props, Custom data properties \ \ Ultimately, this will allow end devs to write less code and we can stop recommending the extension of jQuery.event.propsImplement the ability to specify properties of event.originalEvent to be moved over to event.* for specific event types, without the performance sacrifices of copying all event.originalEvent properties or adding to the globally used jQuery.event.props list \ \ Will be particularly useful for newer events introduced by HTML5 JavaScript APIs that have special properties that are ignored by jQuery.event.fix() when it copies the jQuery.event.props array.\ \ Ex.\ \ Drag/Drop API has "dataTranser", touch event props, messaging event props, Custom data properties\ \ Ultimately, this will allow end devs to write less code and we can stop recommending the extension of jQuery.event.props

+1, might be a way to fix #6942 as well

Changed June 05, 2011 09:26PM UTC by ajpiano comment:14

description: Implement the ability to specify properties of event.originalEvent to be moved over to event.* for specific event types, without the performance sacrifices of copying all event.originalEvent properties or adding to the globally used jQuery.event.props list \ \ Will be particularly useful for newer events introduced by HTML5 JavaScript APIs that have special properties that are ignored by jQuery.event.fix() when it copies the jQuery.event.props array.\ \ Ex.\ \ Drag/Drop API has "dataTranser", touch event props, messaging event props, Custom data properties\ \ Ultimately, this will allow end devs to write less code and we can stop recommending the extension of jQuery.event.propsImplement the ability to specify properties of event.originalEvent to be moved over to event.* for specific event types, without the performance sacrifices of copying all event.originalEvent properties or adding to the globally used jQuery.event.props list \ \ Will be particularly useful for newer events introduced by HTML5 JavaScript APIs that have special properties that are ignored by jQuery.event.fix() when it copies the jQuery.event.props array. \ \ Ex. \ \ Drag/Drop API has "dataTranser", touch event props, messaging event props, Custom data properties \ \ Ultimately, this will allow end devs to write less code and we can stop recommending the extension of jQuery.event.props

+1, rwaldron mentioned that there was a mechanism to do this on a per-event-type basis, is that happening?

Changed June 05, 2011 10:20PM UTC by rwaldron comment:15

To clarify, what @ajpiano refers to is that I had an idea for how to make this work on a per-event type basis, though no code is ready for review.

Changed July 12, 2011 03:02PM UTC by dmethvin comment:16

milestone: 1.next1.7
priority: lowblocker

Changed July 25, 2011 04:02PM UTC by rwaldron comment:17

owner: → rwaldron

Changed September 07, 2011 06:45PM UTC by rwaldron comment:18

keywords: 1.7-discuss1.8-discuss
milestone: 1.71.8

After much consideration, I've decided that this should wait until 1.8 (there will be enough changes to Events in 1.7, this seems like too much at once)

Changed September 12, 2011 04:19PM UTC by rwaldron comment:19

keywords: 1.8-discuss
milestone: 1.81.7

Changed September 26, 2011 05:40PM UTC by Rick Waldron comment:20

resolution: → fixed
status: assignedclosed

Merge branch 'fix-8789-rwldrn-fix' of git://github.com/dmethvin/jquery into fix-8789-rwldrn-fix

  • 'fix-8789-rwldrn-fix' of git://github.com/dmethvin/jquery:

Minor cleanups to code. Futile effort to get IE to pass the unit test.

propHooks now an object with props array and filter function.

Moves mouse properties to mouseProps

current state

Removes early return loop, must copy properties

Shortcircuit fix if possible

More ref localization

Remove unnec. empty line

More reference caching

Cache reference to propHook lookup and result

Restore this.propHooks => jQuery.event.propHooks for better gzip compression. Thanks gnarf

Adds notes re: crash status of fix conditions

Moves key event fixes to own even prop hook defs

jQuery.event.propHooks => this.propHooks where possible

Removes pageX pageY from prop list

Updates rmouseEvent

Implements jQuery.event.propHooks. Fixes #8789

Adds implementation tests for jQuery.event.propHooks #8789

Changeset: 36c82a1bcea14680b7efed47da8f3ebd9bf3de82