MCPcopy Index your code
hub / github.com/JsAaron/jQuery / css_defaultDisplay

Function css_defaultDisplay

2.0.3/2.0.3.js:6594–6623  ·  view source on GitHub ↗
( nodeName )

Source from the content-addressed store, hash-verified

6592
6593// Try to determine the default display value of an element
6594 function css_defaultDisplay( nodeName ) {
6595 var doc = document,
6596 display = elemdisplay[ nodeName ];
6597
6598 if ( !display ) {
6599 display = actualDisplay( nodeName, doc );
6600
6601 // If the simple way fails, read from inside an iframe
6602 if ( display === "none" || !display ) {
6603 // Use the already-created iframe if possible
6604 iframe = ( iframe ||
6605 jQuery("<iframe frameborder='0' width='0' height='0'/>")
6606 .css( "cssText", "display:block !important" )
6607 ).appendTo( doc.documentElement );
6608
6609 // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
6610 doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;
6611 doc.write("<!doctype html><html><body>");
6612 doc.close();
6613
6614 display = actualDisplay( nodeName, doc );
6615 iframe.detach();
6616 }
6617
6618 // Store the correct default display
6619 elemdisplay[ nodeName ] = display;
6620 }
6621
6622 return display;
6623 }
6624
6625// Called ONLY from within css_defaultDisplay
6626 function actualDisplay( name, doc ) {

Callers 1

showHideFunction · 0.70

Calls 2

actualDisplayFunction · 0.70
jQueryFunction · 0.70

Tested by

no test coverage detected