* Support testing using an element * @param {Function} fn Passed the created element and returns a boolean result
( fn )
| 976 | * @param {Function} fn Passed the created element and returns a boolean result |
| 977 | */ |
| 978 | function assert( fn ) { |
| 979 | var el = document.createElement( "fieldset" ); |
| 980 | |
| 981 | try { |
| 982 | return !!fn( el ); |
| 983 | } catch ( e ) { |
| 984 | return false; |
| 985 | } finally { |
| 986 | |
| 987 | // Remove from its parent by default |
| 988 | if ( el.parentNode ) { |
| 989 | el.parentNode.removeChild( el ); |
| 990 | } |
| 991 | |
| 992 | // release memory in IE |
| 993 | el = null; |
| 994 | } |
| 995 | } |
| 996 | |
| 997 | /** |
| 998 | * Returns a function to use in pseudos for input types |
no test coverage detected