- arg = div.childNodes;
- }
-
- if ( arg.length != undefined && !arg.nodeType ) // Handles Array, jQuery, DOM NodeList collections
+
+ // Have to loop through the childNodes here to
+ // prevent a Safari crash with text nodes and /n characters
+ for ( var j = 0; j < div.childNodes.length; j++ )
+ r.push( div.childNodes[j] );
+ }
+ else if ( arg.length != undefined && !arg.nodeType ) // Handles Array, jQuery, DOM NodeList collections