MCPcopy
hub / github.com/stemkoski/stemkoski.github.com / css_defaultDisplay

Function css_defaultDisplay

Three.js/js/jquery-1.9.1.js:7107–7136  ·  view source on GitHub ↗
( nodeName )

Source from the content-addressed store, hash-verified

7105
7106// Try to determine the default display value of an element
7107function 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
7139function actualDisplay( name, doc ) {

Callers 2

showHideFunction · 0.85
defaultPrefilterFunction · 0.85

Calls 2

actualDisplayFunction · 0.85
jQueryFunction · 0.85

Tested by

no test coverage detected