Commit 84f29084 authored by timmywil's avatar timmywil

Revert "Landing pull request 461. Adds a due diligence check for pre-defined...

Revert "Landing pull request 461. Adds a due diligence check for pre-defined data-* attrs during removal. Fixes #10026."

This reverts commit 6805fc2c.

A more cache-friendly solution is in the works.
parent 6805fc2c
...@@ -167,11 +167,6 @@ jQuery.extend({ ...@@ -167,11 +167,6 @@ jQuery.extend({
delete thisCache[ name ]; 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 // If there is no data left in the cache, we want to continue
// and let the cache object itself get destroyed // and let the cache object itself get destroyed
if ( !isEmptyDataObject(thisCache) ) { if ( !isEmptyDataObject(thisCache) ) {
......
...@@ -568,7 +568,7 @@ test("jQuery.data supports interoperable removal of hyphenated/camelCase propert ...@@ -568,7 +568,7 @@ test("jQuery.data supports interoperable removal of hyphenated/camelCase propert
"some-json": '{ "foo": "bar" }' "some-json": '{ "foo": "bar" }'
}; };
expect( 29 ); expect( 27 );
jQuery.each( datas, function( key, val ) { jQuery.each( datas, function( key, val ) {
div.data( key, val ); div.data( key, val );
...@@ -581,15 +581,4 @@ test("jQuery.data supports interoperable removal of hyphenated/camelCase propert ...@@ -581,15 +581,4 @@ test("jQuery.data supports interoperable removal of hyphenated/camelCase propert
equal( div.data( key ), undefined, "get: " + key ); 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" );
}); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment