( nodeName )
| 7105 | |
| 7106 | // Try to determine the default display value of an element |
| 7107 | function css_defaultDisplay( nodeName ) { |
| 7108 | var doc = document, |
| 7109 | display = elemdisplay[ nodeName ]; |
| 7110 | |
| 7111 | if ( !display ) { |
| 7112 | display = actualDisplay( nodeName, doc ); |
| 7113 | |
| 7114 | // If the simple way fails, read from inside an iframe |
| 7115 | if ( display === "none" || !display ) { |
| 7116 | // Use the already-created iframe if possible |
| 7117 | iframe = ( iframe || |
| 7118 | jQuery("<iframe frameborder='0' width='0' height='0'/>") |
| 7119 | .css( "cssText", "display:block !important" ) |
| 7120 | ).appendTo( doc.documentElement ); |
| 7121 | |
| 7122 | // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse |
| 7123 | doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document; |
| 7124 | doc.write("<!doctype html><html><body>"); |
| 7125 | doc.close(); |
| 7126 | |
| 7127 | display = actualDisplay( nodeName, doc ); |
| 7128 | iframe.detach(); |
| 7129 | } |
| 7130 | |
| 7131 | // Store the correct default display |
| 7132 | elemdisplay[ nodeName ] = display; |
| 7133 | } |
| 7134 | |
| 7135 | return display; |
| 7136 | } |
| 7137 | |
| 7138 | // Called ONLY from within css_defaultDisplay |
| 7139 | function actualDisplay( name, doc ) { |
no test coverage detected