diff options
author | Dave Methvin <dave.methvin@gmail.com> | 2011-11-21 11:33:21 -0500 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2011-11-21 11:33:21 -0500 |
commit | 8cb065addc13a8042523b6db4bfd1d80a33c9a46 (patch) | |
tree | db54b745969c49cadced74a19e28ac2ba539e614 /test/unit/event.js | |
parent | 1eb1ad616069ab103ceecf48c48514f51dd5d5ac (diff) | |
download | jquery-8cb065addc13a8042523b6db4bfd1d80a33c9a46.tar.gz jquery-8cb065addc13a8042523b6db4bfd1d80a33c9a46.zip |
Fix #10844. Harden quickIs() against form-aliasing of the id property.
Diffstat (limited to 'test/unit/event.js')
-rw-r--r-- | test/unit/event.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/unit/event.js b/test/unit/event.js index eb5f98fb8..4ad8f9d85 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -1209,6 +1209,29 @@ test("Delegated events in SVG (#10791)", function() { svg.remove(); }); +test("Delegated events in forms (#10844)", function() { + expect(1); + + // Aliases names like "id" cause havoc + var form = jQuery( + '<form id="myform">'+ + '<input type="text" name="id" value="secret agent man" />'+ + '</form>' + ).appendTo( "body" ); + + jQuery( "body" ) + .on( "submit", "#myform", function() { + ok( true, "delegated id selector with aliased name" ); + return false; + }) + .find( "#myform" ) + .trigger( "submit" ) + .end() + .off( "submit" ); + + form.remove(); +}); + test("jQuery.Event( type, props )", function() { expect(5); |