]> source.dussan.org Git - jquery.git/commitdiff
Revert "Landing pull request 461. Adds a due diligence check for pre-defined data...
authortimmywil <timmywillisn@gmail.com>
Mon, 22 Aug 2011 19:02:46 +0000 (15:02 -0400)
committertimmywil <timmywillisn@gmail.com>
Mon, 22 Aug 2011 19:02:46 +0000 (15:02 -0400)
This reverts commit 6805fc2cd20e36af5c1b0c51f6f39f21cea4609a.

A more cache-friendly solution is in the works.

src/data.js
test/unit/data.js

index 763b3df128548ec6470182f6f7ed2fe8e63d26be..4f87a355042fe0ead6195dfbfd5ab3fcab62c07f 100644 (file)
@@ -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) ) {
index 37d29bc201810033a39a69fff8dffcf38cd784e4..4e21f563e7b54d227606183e199a71499ebb4287 100644 (file)
@@ -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("<div data-msg='hello'></div>");
-
-       equal( div.data("msg"), "hello", "<div data-msg='hello'></div> has expected data" );
-
-       div.removeData("msg");
-
-       equal( div.data("msg"), undefined, "data-msg removed correctly" );
 });