( nodeName )
| 8849 | |
| 8850 | // Try to restore the default display value of an element |
| 8851 | function defaultDisplay( nodeName ) { |
| 8852 | |
| 8853 | if ( !elemdisplay[ nodeName ] ) { |
| 8854 | |
| 8855 | var body = document.body, |
| 8856 | elem = jQuery( "<" + nodeName + ">" ).appendTo( body ), |
| 8857 | display = elem.css( "display" ); |
| 8858 | elem.remove(); |
| 8859 | |
| 8860 | // If the simple way fails, |
| 8861 | // get element's real default display by attaching it to a temp iframe |
| 8862 | if ( display === "none" || display === "" ) { |
| 8863 | // No iframe to use yet, so create it |
| 8864 | if ( !iframe ) { |
| 8865 | iframe = document.createElement( "iframe" ); |
| 8866 | iframe.frameBorder = iframe.width = iframe.height = 0; |
| 8867 | } |
| 8868 | |
| 8869 | body.appendChild( iframe ); |
| 8870 | |
| 8871 | // Create a cacheable copy of the iframe document on first call. |
| 8872 | // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML |
| 8873 | // document to it; WebKit & Firefox won't allow reusing the iframe document. |
| 8874 | if ( !iframeDoc || !iframe.createElement ) { |
| 8875 | iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document; |
| 8876 | iframeDoc.write( ( document.compatMode === "CSS1Compat" ? "<!doctype html>" : "" ) + "<html><body>" ); |
| 8877 | iframeDoc.close(); |
| 8878 | } |
| 8879 | |
| 8880 | elem = iframeDoc.createElement( nodeName ); |
| 8881 | |
| 8882 | iframeDoc.body.appendChild( elem ); |
| 8883 | |
| 8884 | display = jQuery.css( elem, "display" ); |
| 8885 | body.removeChild( iframe ); |
| 8886 | } |
| 8887 | |
| 8888 | // Store the correct default display |
| 8889 | elemdisplay[ nodeName ] = display; |
| 8890 | } |
| 8891 | |
| 8892 | return elemdisplay[ nodeName ]; |
| 8893 | } |
| 8894 | |
| 8895 | |
| 8896 |
no test coverage detected
searching dependent graphs…