This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -659,8 +659,9 @@ forEach({
659
659
660
660
append : function ( element , node ) {
661
661
forEach ( new JQLite ( node ) , function ( child ) {
662
- if ( element . nodeType === 1 )
662
+ if ( element . nodeType === 1 || element . nodeType === 11 ) {
663
663
element . appendChild ( child ) ;
664
+ }
664
665
} ) ;
665
666
} ,
666
667
Original file line number Diff line number Diff line change @@ -955,9 +955,14 @@ describe('jqLite', function() {
955
955
expect ( root . append ( 'text' ) ) . toEqual ( root ) ;
956
956
expect ( root . html ( ) ) . toEqual ( 'text' ) ;
957
957
} ) ;
958
- it ( 'should not append anything if parent node is not of type element ' , function ( ) {
958
+ it ( 'should append to document fragment ' , function ( ) {
959
959
var root = jqLite ( document . createDocumentFragment ( ) ) ;
960
960
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 ) ;
961
966
expect ( root . children ( ) . length ) . toBe ( 0 ) ;
962
967
} ) ;
963
968
} ) ;
You can’t perform that action at this time.
0 commit comments