diff options
-rw-r--r-- | src/event.js | 4 | ||||
-rw-r--r-- | test/index.html | 5 | ||||
-rw-r--r-- | test/unit/event.js | 3 |
3 files changed, 10 insertions, 2 deletions
diff --git a/src/event.js b/src/event.js index d6b116d2e..316a7fee1 100644 --- a/src/event.js +++ b/src/event.js @@ -800,7 +800,7 @@ if ( !jQuery.support.changeBubbles ) { beforedeactivate: testChange, click: function( e ) { - var elem = e.target, type = elem.type; + var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : ""; if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) { testChange.call( this, e ); @@ -810,7 +810,7 @@ if ( !jQuery.support.changeBubbles ) { // Change has to be called before submit // Keydown will be called before keypress, which is used in submit-event delegation keydown: function( e ) { - var elem = e.target, type = elem.type; + var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : ""; if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") || (e.keyCode === 32 && (type === "checkbox" || type === "radio")) || diff --git a/test/index.html b/test/index.html index a10655089..bf7dc7989 100644 --- a/test/index.html +++ b/test/index.html @@ -45,6 +45,10 @@ <script src="unit/effects.js"></script> <script src="unit/offset.js"></script> <script src="unit/dimensions.js"></script> + + <!-- For testing http://bugs.jquery.com/ticket/7071 --> + <xml:namespace ns="urn:schemas-microsoft-com:vml" prefix="v" /> + <style>v\:oval { behavior:url(#default#VML); display:inline-block; }</style> </head> <body id="body"> @@ -147,6 +151,7 @@ <span id="test.foo[5]bar" class="test.foo[5]bar"></span> <foo_bar id="foobar">test element</foo_bar> + <v:oval id="oval" style="width:100pt;height:75pt;" fillcolor="red"> </v:oval> </form> <b id="floatTest">Float test.</b> <iframe id="iframe" name="iframe"></iframe> diff --git a/test/unit/event.js b/test/unit/event.js index b46ef9ebb..491396f93 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -776,6 +776,9 @@ test("trigger() shortcuts", function() { // manually clean up detached elements elem.remove(); + + // test that special handlers do not blow up with VML elements (#7071) + jQuery("#oval").click().keydown(); }); test("trigger() bubbling", function() { |