| 4196 | } |
| 4197 | |
| 4198 | function buildFragment( args, nodes, scripts ) { |
| 4199 | var fragment, cacheable, cacheresults, doc; |
| 4200 | |
| 4201 | // webkit does not clone 'checked' attribute of radio inputs on cloneNode, so don't cache if string has a checked |
| 4202 | if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && args[0].indexOf("<option") < 0 && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) { |
| 4203 | cacheable = true; |
| 4204 | cacheresults = jQuery.fragments[ args[0] ]; |
| 4205 | if ( cacheresults ) { |
| 4206 | if ( cacheresults !== 1 ) { |
| 4207 | fragment = cacheresults; |
| 4208 | } |
| 4209 | } |
| 4210 | } |
| 4211 | |
| 4212 | if ( !fragment ) { |
| 4213 | doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document); |
| 4214 | fragment = doc.createDocumentFragment(); |
| 4215 | jQuery.clean( args, doc, fragment, scripts ); |
| 4216 | } |
| 4217 | |
| 4218 | if ( cacheable ) { |
| 4219 | jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1; |
| 4220 | } |
| 4221 | |
| 4222 | return { fragment: fragment, cacheable: cacheable }; |
| 4223 | } |
| 4224 | |
| 4225 | jQuery.fragments = {}; |
| 4226 | |