Skip to content
Permalink
Browse files

Accessing the 'type' property on VML elements fails on IE. Fixes #7071.

  • Loading branch information...
John Firebaugh authored and jeresig committed Apr 12, 2011
1 parent 3418f32 commit 0d8b247cab2f91e118d0b734028ce827e09a71f7
Showing with 10 additions and 2 deletions.
  1. +2 −2 src/event.js
  2. +5 −0 test/index.html
  3. +3 −0 test/unit/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")) ||
@@ -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 @@ <h2 id="qunit-userAgent"></h2>
<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>
@@ -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() {

1 comment on commit 0d8b247

@jfirebaugh

This comment has been minimized.

Copy link

jfirebaugh commented on 0d8b247 Apr 12, 2011

I believe the addition of a VML element to the test HTML causes failures not fixed by the event.js change.

jquery/sizzle#32 is about fixing those.

Please sign in to comment.
You can’t perform that action at this time.