Fixed #1039 and #1733 by going through the core API and making them text node and comment node safe.

This commit is contained in:
David Serduke 2007-12-07 01:52:21 +00:00
parent 12ef255ffd
commit ffbedf0262
8 changed files with 188 additions and 64 deletions

View file

@ -1,12 +1,17 @@
module("fx");
test("animate(Hash, Object, Function)", function() {
expect(1);
expect(3);
stop();
var hash = {opacity: 'show'};
var hashCopy = $.extend({}, hash);
$('#foo').animate(hash, 0, function() {
ok( hash.opacity == hashCopy.opacity, 'Check if animate changed the hash parameter' );
});
// using contents will get comments regular, text, and comment nodes
$("#nonnodes").contents().animate({paddingLeft:"5px"}, 100, function () {
equals(this.nodeType, 1, "Check node,textnode,comment animate just does real nodes" );
equals($(this).css("paddingLeft"), "5px", "Check node,textnode,comment animate just does real nodes" );
start();
});
});