* Support testing using an element * @param {Function} fn Passed the created div and expects a boolean result
( fn )
| 1323 | * @param {Function} fn Passed the created div and expects a boolean result |
| 1324 | */ |
| 1325 | function assert( fn ) { |
| 1326 | var div = document.createElement("div"); |
| 1327 | |
| 1328 | try { |
| 1329 | return !!fn( div ); |
| 1330 | } catch (e) { |
| 1331 | return false; |
| 1332 | } finally { |
| 1333 | // Remove from its parent by default |
| 1334 | if ( div.parentNode ) { |
| 1335 | div.parentNode.removeChild( div ); |
| 1336 | } |
| 1337 | // release memory in IE |
| 1338 | div = null; |
| 1339 | } |
| 1340 | } |
| 1341 | |
| 1342 | /** |
| 1343 | * Adds the same handler for all of the specified attrs |
no test coverage detected