diff options
author | Oleg <markelog@gmail.com> | 2012-04-16 21:57:41 -0400 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2012-04-16 21:57:41 -0400 |
commit | abd2a07498afa48a4ec3ce0471b9b0b4fc812b55 (patch) | |
tree | d108cb24a30d0d67f9cde1189e9711a64e3dc73c /test | |
parent | 8fadc5ba01bc517ebb07736d5af9a965ed133a39 (diff) | |
download | jquery-abd2a07498afa48a4ec3ce0471b9b0b4fc812b55.tar.gz jquery-abd2a07498afa48a4ec3ce0471b9b0b4fc812b55.zip |
Fix #8894. Ensure `.appendTo` creates a new set in oldIE.
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/manipulation.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index 4aae3e28e..672b204e1 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -571,7 +571,7 @@ test("IE8 serialization bug", function () { test("html() object element #10324", function() { expect( 1 ); - var object = jQuery("<object id='object2'><param name='object2test' value='test'></param></object>").appendTo("#qunit-fixture"), + var object = jQuery("<object id='object2'><param name='object2test' value='test'></param></object>?").appendTo("#qunit-fixture"), clone = object.clone(); equal( clone.html(), object.html(), "html() returns correct innerhtml of cloned object elements" ); @@ -1776,3 +1776,11 @@ test("Guard against exceptions when clearing safeChildNodes", function() { ok( div && div.jquery, "Created nodes safely, guarded against exceptions on safeChildNodes[ -1 ]" ); }); + +test("Ensure oldIE creates a new set on appendTo (#8894)", function() { + strictEqual( jQuery("<div/>").clone().addClass("test").appendTo("<div/>").end().hasClass("test"), false, "Check jQuery.fn.appendTo after jQuery.clone" ); + strictEqual( jQuery("<div/>").find("p").end().addClass("test").appendTo("<div/>").end().hasClass("test"), false, "Check jQuery.fn.appendTo after jQuery.fn.find" ); + strictEqual( jQuery("<div/>").text("test").addClass("test").appendTo("<div/>").end().hasClass("test"), false, "Check jQuery.fn.appendTo after jQuery.fn.text" ); + strictEqual( jQuery("<bdi/>").clone().addClass("test").appendTo("<div/>").end().hasClass("test"), false, "Check jQuery.fn.appendTo after clone html5 element" ); + strictEqual( jQuery("<p/>").appendTo("<div/>").end().length, jQuery("<p>test</p>").appendTo("<div/>").end().length, "Elements created with createElement and with createDocumentFragment should be treated alike" ); +}); |