File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
66 rtagName = / < ( [ \w : ] + ) / ,
77 rtbody = / < t b o d y / i,
88 rhtml = / < | & # ? \w + ; / ,
9+ rnoInnerhtml = / < (?: s c r i p t | s t y l e ) / i,
910 rnocache = / < (?: s c r i p t | o b j e c t | e m b e d | o p t i o n | s t y l e ) / i,
1011 // checked="checked" or checked
1112 rchecked = / c h e c k e d \s * (?: [ ^ = ] | = \s * .c h e c k e d .) / i,
@@ -217,7 +218,7 @@ jQuery.fn.extend({
217218 null ;
218219
219220 // See if we can take a shortcut and just use innerHTML
220- } else if ( typeof value === "string" && ! rnocache . test ( value ) &&
221+ } else if ( typeof value === "string" && ! rnoInnerhtml . test ( value ) &&
221222 ( jQuery . support . leadingWhitespace || ! rleadingWhitespace . test ( value ) ) &&
222223 ! wrapMap [ ( rtagName . exec ( value ) || [ "" , "" ] ) [ 1 ] . toLowerCase ( ) ] ) {
223224
Original file line number Diff line number Diff line change @@ -991,7 +991,7 @@ test("clone() (#8070)", function () {
991991} ) ;
992992
993993test ( "clone()" , function ( ) {
994- expect ( 37 ) ;
994+ expect ( 40 ) ;
995995 equals ( "This is a normal link: Yahoo" , jQuery ( "#en" ) . text ( ) , "Assert text for #en" ) ;
996996 var clone = jQuery ( "#yahoo" ) . clone ( ) ;
997997 equals ( "Try them out:Yahoo" , jQuery ( "#first" ) . append ( clone ) . text ( ) , "Check for clone" ) ;
@@ -1058,6 +1058,14 @@ test("clone()", function() {
10581058 cloneEvt . remove ( ) ;
10591059 divEvt . remove ( ) ;
10601060
1061+ // Test both html() and clone() for <embed and <object types
1062+ div = jQuery ( "<div/>" ) . html ( '<embed height="355" width="425" src="http://www.youtube.com/v/3KANI2dpXLw&hl=en"></embed>' ) ;
1063+
1064+ clone = div . clone ( true ) ;
1065+ equals ( clone . length , 1 , "One element cloned" ) ;
1066+ equals ( clone . html ( ) , div . html ( ) , "Element contents cloned" ) ;
1067+ equals ( clone [ 0 ] . nodeName . toUpperCase ( ) , "DIV" , "DIV element cloned" ) ;
1068+
10611069 // this is technically an invalid object, but because of the special
10621070 // classid instantiation it is the only kind that IE has trouble with,
10631071 // so let's test with it too.
You can’t perform that action at this time.
0 commit comments