MCPcopy Create free account
hub / github.com/JsAaron/jQuery / defaultDisplay

Function defaultDisplay

2.1.1/test/jquery-1.11.1.js:6031–6060  ·  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

6029 * @param {String} nodeName
6030 */
6031function defaultDisplay( nodeName ) {
6032 var doc = document,
6033 display = elemdisplay[ nodeName ];
6034
6035 if ( !display ) {
6036 display = actualDisplay( nodeName, doc );
6037
6038 // If the simple way fails, read from inside an iframe
6039 if ( display === "none" || !display ) {
6040
6041 // Use the already-created iframe if possible
6042 iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement );
6043
6044 // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
6045 doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document;
6046
6047 // Support: IE
6048 doc.write();
6049 doc.close();
6050
6051 display = actualDisplay( nodeName, doc );
6052 iframe.detach();
6053 }
6054
6055 // Store the correct default display
6056 elemdisplay[ nodeName ] = display;
6057 }
6058
6059 return display;
6060}
6061
6062
6063(function() {

Callers 2

showHideFunction · 0.70
defaultPrefilterFunction · 0.70

Calls 2

actualDisplayFunction · 0.70
jQueryFunction · 0.70

Tested by

no test coverage detected