From cef3450228f53a1facfbed2be77050e61ee6a178 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Wed, 2 Jan 2013 21:25:49 -0500 Subject: [PATCH] Remove noCloneEvent detects and white-box unit test. --- src/support.js | 12 ----------- test/unit/manipulation.js | 42 --------------------------------------- 2 files changed, 54 deletions(-) diff --git a/src/support.js b/src/support.js index 36b91b5e4..3c763092f 100644 --- a/src/support.js +++ b/src/support.js @@ -36,7 +36,6 @@ jQuery.support = (function() { boxModel: document.compatMode === "CSS1Compat", // Will be defined later - noCloneEvent: true, reliableMarginRight: true, boxSizingReliable: true, pixelPosition: false @@ -71,17 +70,6 @@ jQuery.support = (function() { // WebKit doesn't clone checked state correctly in fragments support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; - // Support: IE<9 - // Opera does not clone events (and typeof div.attachEvent === undefined). - // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() - if ( div.attachEvent ) { - div.attachEvent( "onclick", function() { - support.noCloneEvent = false; - }); - - div.cloneNode( true ).click(); - } - // Support: Firefox 17+ // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php div.setAttribute( "onfocusin", "t" ); diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index d9b014187..25ca9cd5b 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -626,48 +626,6 @@ test( "replaceWith([]) where replacing element requires cloning", function () { "Make sure replacing elements were cloned" ); }); - -test( "append the same fragment with events (Bug #6997, 5566)", function() { - - var element, clone, - doExtra = !jQuery.support.noCloneEvent && document["fireEvent"]; - - expect( 2 + ( doExtra ? 1 : 0 ) ); - - stop(); - - // This patch modified the way that cloning occurs in IE; we need to make sure that - // native event handlers on the original object don't get disturbed when they are - // modified on the clone - if ( doExtra ) { - element = jQuery("div:first").click(function() { - ok( true, "Event exists on original after being unbound on clone" ); - jQuery( this ).unbind("click"); - }); - clone = element.clone( true ).unbind("click"); - clone[ 0 ].fireEvent("onclick"); - element[ 0 ].fireEvent("onclick"); - - // manually clean up detached elements - clone.remove(); - } - - element = jQuery("").click(function() { - ok( true, "Append second element events work" ); - }); - - jQuery("#listWithTabIndex li").append( element ) - .find("a.test6997").eq( 1 ).click(); - - element = jQuery("
  • ").click(function() { - ok( true, "Before second element events work" ); - start(); - }); - - jQuery("#listWithTabIndex li").before( element ); - jQuery("#listWithTabIndex li.test6997").eq( 1 ).click(); -}); - test( "append HTML5 sectioning elements (Bug #6485)", function() { expect( 2 ); -- 2.39.5