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

Function defaultDisplay

2.1.1/src/css/defaultDisplay.js:37–66  ·  view source on GitHub ↗

* Try to determine the default display value of an element * @param {String} nodeName

( nodeName )

Source from the content-addressed store, hash-verified

35 * @param {String} nodeName
36 */
37function defaultDisplay( nodeName ) {
38 var doc = document,
39 display = elemdisplay[ nodeName ];
40
41 if ( !display ) {
42 display = actualDisplay( nodeName, doc );
43
44 // If the simple way fails, read from inside an iframe
45 if ( display === "none" || !display ) {
46
47 // Use the already-created iframe if possible
48 iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement );
49
50 // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
51 doc = iframe[ 0 ].contentDocument;
52
53 // Support: IE
54 doc.write();
55 doc.close();
56
57 display = actualDisplay( nodeName, doc );
58 iframe.detach();
59 }
60
61 // Store the correct default display
62 elemdisplay[ nodeName ] = display;
63 }
64
65 return display;
66}
67
68return defaultDisplay;
69

Callers 2

defaultPrefilterFunction · 0.50
showHideFunction · 0.50

Calls 2

actualDisplayFunction · 0.70
jQueryFunction · 0.50

Tested by

no test coverage detected