This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -659,8 +659,9 @@ forEach({
659659
660660 append : function ( element , node ) {
661661 forEach ( new JQLite ( node ) , function ( child ) {
662- if ( element . nodeType === 1 )
662+ if ( element . nodeType === 1 || element . nodeType === 11 ) {
663663 element . appendChild ( child ) ;
664+ }
664665 } ) ;
665666 } ,
666667
Original file line number Diff line number Diff line change @@ -955,9 +955,14 @@ describe('jqLite', function() {
955955 expect ( root . append ( 'text' ) ) . toEqual ( root ) ;
956956 expect ( root . html ( ) ) . toEqual ( 'text' ) ;
957957 } ) ;
958- it ( 'should not append anything if parent node is not of type element ' , function ( ) {
958+ it ( 'should append to document fragment ' , function ( ) {
959959 var root = jqLite ( document . createDocumentFragment ( ) ) ;
960960 expect ( root . append ( '<p>foo</p>' ) ) . toBe ( root ) ;
961+ expect ( root . children ( ) . length ) . toBe ( 1 ) ;
962+ } ) ;
963+ it ( 'should not append anything if parent node is not of type element or docfrag' , function ( ) {
964+ var root = jqLite ( '<p>some text node</p>' ) . contents ( ) ;
965+ expect ( root . append ( '<p>foo</p>' ) ) . toBe ( root ) ;
961966 expect ( root . children ( ) . length ) . toBe ( 0 ) ;
962967 } ) ;
963968 } ) ;
You can’t perform that action at this time.
0 commit comments