( nodeName )
| 7264 | |
| 7265 | // Try to determine the default display value of an element |
| 7266 | function css_defaultDisplay( nodeName ) { |
| 7267 | var doc = document, |
| 7268 | display = elemdisplay[ nodeName ]; |
| 7269 | |
| 7270 | if ( !display ) { |
| 7271 | display = actualDisplay( nodeName, doc ); |
| 7272 | |
| 7273 | // If the simple way fails, read from inside an iframe |
| 7274 | if ( display === "none" || !display ) { |
| 7275 | // Use the already-created iframe if possible |
| 7276 | iframe = ( iframe || |
| 7277 | jQuery("<iframe frameborder='0' width='0' height='0'/>") |
| 7278 | .css( "cssText", "display:block !important" ) |
| 7279 | ).appendTo( doc.documentElement ); |
| 7280 | |
| 7281 | // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse |
| 7282 | doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document; |
| 7283 | doc.write("<!doctype html><html><body>"); |
| 7284 | doc.close(); |
| 7285 | |
| 7286 | display = actualDisplay( nodeName, doc ); |
| 7287 | iframe.detach(); |
| 7288 | } |
| 7289 | |
| 7290 | // Store the correct default display |
| 7291 | elemdisplay[ nodeName ] = display; |
| 7292 | } |
| 7293 | |
| 7294 | return display; |
| 7295 | } |
| 7296 | |
| 7297 | // Called ONLY from within css_defaultDisplay |
| 7298 | function actualDisplay( name, doc ) { |
no test coverage detected