Skip to content

Commit 84f2908

Browse files
committed
Revert "Landing pull request 461. Adds a due diligence check for pre-defined data-* attrs during removal. Fixes #10026."
This reverts commit 6805fc2. A more cache-friendly solution is in the works.
1 parent 6805fc2 commit 84f2908

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

src/data.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,6 @@ jQuery.extend({
167167

168168
delete thisCache[ name ];
169169

170-
// Check the actual element for predefined data-* attrs, #10027
171-
if ( jQuery.attr( elem, "data-" + name ) ) {
172-
jQuery.removeAttr( elem, "data-" + name );
173-
}
174-
175170
// If there is no data left in the cache, we want to continue
176171
// and let the cache object itself get destroyed
177172
if ( !isEmptyDataObject(thisCache) ) {

test/unit/data.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ test("jQuery.data supports interoperable removal of hyphenated/camelCase propert
568568
"some-json": '{ "foo": "bar" }'
569569
};
570570

571-
expect( 29 );
571+
expect( 27 );
572572

573573
jQuery.each( datas, function( key, val ) {
574574
div.data( key, val );
@@ -581,15 +581,4 @@ test("jQuery.data supports interoperable removal of hyphenated/camelCase propert
581581
equal( div.data( key ), undefined, "get: " + key );
582582

583583
});
584-
585-
div.remove();
586-
587-
// Covers #10027
588-
div = jQuery("<div data-msg='hello'></div>");
589-
590-
equal( div.data("msg"), "hello", "<div data-msg='hello'></div> has expected data" );
591-
592-
div.removeData("msg");
593-
594-
equal( div.data("msg"), undefined, "data-msg removed correctly" );
595584
});

0 commit comments

Comments
 (0)