From 84f29084d6ac8077ce5dcb4dd94d43aaeed18fb0 Mon Sep 17 00:00:00 2001 From: timmywil Date: Mon, 22 Aug 2011 15:02:46 -0400 Subject: [PATCH] Revert "Landing pull request 461. Adds a due diligence check for pre-defined data-* attrs during removal. Fixes #10026." This reverts commit 6805fc2cd20e36af5c1b0c51f6f39f21cea4609a. A more cache-friendly solution is in the works. --- src/data.js | 5 ----- test/unit/data.js | 13 +------------ 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/data.js b/src/data.js index 763b3df12..4f87a3550 100644 --- a/src/data.js +++ b/src/data.js @@ -167,11 +167,6 @@ jQuery.extend({ delete thisCache[ name ]; - // Check the actual element for predefined data-* attrs, #10027 - if ( jQuery.attr( elem, "data-" + name ) ) { - jQuery.removeAttr( elem, "data-" + name ); - } - // If there is no data left in the cache, we want to continue // and let the cache object itself get destroyed if ( !isEmptyDataObject(thisCache) ) { diff --git a/test/unit/data.js b/test/unit/data.js index 37d29bc20..4e21f563e 100644 --- a/test/unit/data.js +++ b/test/unit/data.js @@ -568,7 +568,7 @@ test("jQuery.data supports interoperable removal of hyphenated/camelCase propert "some-json": '{ "foo": "bar" }' }; - expect( 29 ); + expect( 27 ); jQuery.each( datas, function( key, val ) { div.data( key, val ); @@ -581,15 +581,4 @@ test("jQuery.data supports interoperable removal of hyphenated/camelCase propert equal( div.data( key ), undefined, "get: " + key ); }); - - div.remove(); - - // Covers #10027 - div = jQuery("
"); - - equal( div.data("msg"), "hello", "
has expected data" ); - - div.removeData("msg"); - - equal( div.data("msg"), undefined, "data-msg removed correctly" ); }); -- 2.39.5