]> source.dussan.org Git - jquery.git/commitdiff
Shortcircuit fix if possible
authorRick Waldron <waldron.rick@gmail.com>
Thu, 22 Sep 2011 15:30:03 +0000 (11:30 -0400)
committerRick Waldron <waldron.rick@gmail.com>
Thu, 22 Sep 2011 15:30:03 +0000 (11:30 -0400)
src/event.js

index 38ed3ae91bfcf37ec72ea6689b482c680b2699e3..fec3e6d495d33bec40187a1bb4cecbf65ab6d920 100644 (file)
@@ -492,6 +492,11 @@ jQuery.event = {
                event = jQuery.Event( originalEvent );
                propHook = jQuery.event.propHooks[ event.type ];
 
+               // Determine if an early return is possible
+               if ( !propHook && ( event.target && event.target.nodeType !== 3 ) && event.relatedTarget ) {
+                       return event;
+               }
+
                for ( var i = this.props.length, prop; i; ) {
                        prop = this.props[ --i ];
                        event[ prop ] = originalEvent[ prop ];