* Support testing using an element * @param {Function} fn Passed the created div and expects a boolean result
( fn )
| 1190 | * @param {Function} fn Passed the created div and expects a boolean result |
| 1191 | */ |
| 1192 | function assert( fn ) { |
| 1193 | var div = document.createElement("div"); |
| 1194 | |
| 1195 | try { |
| 1196 | return !!fn( div ); |
| 1197 | } catch (e) { |
| 1198 | return false; |
| 1199 | } finally { |
| 1200 | // Remove from its parent by default |
| 1201 | if ( div.parentNode ) { |
| 1202 | div.parentNode.removeChild( div ); |
| 1203 | } |
| 1204 | // release memory in IE |
| 1205 | div = null; |
| 1206 | } |
| 1207 | } |
| 1208 | |
| 1209 | /** |
| 1210 | * Adds the same handler for all of the specified attrs |
no test coverage detected