File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -51,8 +51,8 @@ jQuery.extend( {
5151 return results ;
5252 }
5353
54- // Early return if context is not an element or document
55- if ( ( nodeType = context . nodeType ) !== 1 && nodeType !== 9 ) {
54+ // Early return if context is not an element, document or document fragment
55+ if ( ( nodeType = context . nodeType ) !== 1 && nodeType !== 9 && nodeType !== 11 ) {
5656 return [ ] ;
5757 }
5858
Original file line number Diff line number Diff line change @@ -1908,6 +1908,21 @@ QUnit.testUnlessIE( "jQuery.contains within <template/> doesn't throw (gh-5147)"
19081908 assert . ok ( true , "Didn't throw" ) ;
19091909} ) ;
19101910
1911+ QUnit . test ( "find in document fragments" , function ( assert ) {
1912+ assert . expect ( 1 ) ;
1913+
1914+ var elem ,
1915+ nonnodes = jQuery ( "#nonnodes" ) . contents ( ) ,
1916+ fragment = document . createDocumentFragment ( ) ;
1917+
1918+ nonnodes . each ( function ( ) {
1919+ fragment . appendChild ( this ) ;
1920+ } ) ;
1921+
1922+ elem = jQuery ( fragment ) . find ( "#nonnodesElement" ) ;
1923+ assert . strictEqual ( elem . length , 1 , "Selection works" ) ;
1924+ } ) ;
1925+
19111926QUnit . test ( "jQuery.uniqueSort" , function ( assert ) {
19121927 assert . expect ( 14 ) ;
19131928
You can’t perform that action at this time.
0 commit comments