diff options
author | Dave Methvin <dave.methvin@gmail.com> | 2011-09-21 23:05:26 -0400 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2011-09-21 23:05:26 -0400 |
commit | d638aa9c6d6394db0c06431560b3d8b83cacc61c (patch) | |
tree | 95d9817d17be43e69c51186b127371c15952fd43 /test | |
parent | a4cdbf09ee97471ec041d83ceb8f3feb9825b2a1 (diff) | |
parent | 2746d7f29976462499fa98181986f47c75258c94 (diff) | |
download | jquery-d638aa9c6d6394db0c06431560b3d8b83cacc61c.tar.gz jquery-d638aa9c6d6394db0c06431560b3d8b83cacc61c.zip |
Allow more cases to use `innerHTML` in the `.html` method.
Thanks @cmcnulty for the pull and the patience!
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 64c07498b..c60c3201d 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -991,7 +991,7 @@ test("clone() (#8070)", function () { }); test("clone()", function() { - expect(37); + expect(40); equals( "This is a normal link: Yahoo", jQuery("#en").text(), "Assert text for #en" ); var clone = jQuery("#yahoo").clone(); equals( "Try them out:Yahoo", jQuery("#first").append(clone).text(), "Check for clone" ); @@ -1058,6 +1058,14 @@ test("clone()", function() { cloneEvt.remove(); divEvt.remove(); + // Test both html() and clone() for <embed and <object types + div = jQuery("<div/>").html('<embed height="355" width="425" src="http://www.youtube.com/v/3KANI2dpXLw&hl=en"></embed>'); + + clone = div.clone(true); + equals( clone.length, 1, "One element cloned" ); + equals( clone.html(), div.html(), "Element contents cloned" ); + equals( clone[0].nodeName.toUpperCase(), "DIV", "DIV element cloned" ); + // this is technically an invalid object, but because of the special // classid instantiation it is the only kind that IE has trouble with, // so let's test with it too. |