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

Function defaultDisplay

2.1.1/test/jquery-2.1.1.js:5481–5510  ·  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

5479 * @param {String} nodeName
5480 */
5481function defaultDisplay( nodeName ) {
5482 var doc = document,
5483 display = elemdisplay[ nodeName ];
5484
5485 if ( !display ) {
5486 display = actualDisplay( nodeName, doc );
5487
5488 // If the simple way fails, read from inside an iframe
5489 if ( display === "none" || !display ) {
5490
5491 // Use the already-created iframe if possible
5492 iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement );
5493
5494 // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
5495 doc = iframe[ 0 ].contentDocument;
5496
5497 // Support: IE
5498 doc.write();
5499 doc.close();
5500
5501 display = actualDisplay( nodeName, doc );
5502 iframe.detach();
5503 }
5504
5505 // Store the correct default display
5506 elemdisplay[ nodeName ] = display;
5507 }
5508
5509 return display;
5510}
5511var rmargin = (/^margin/);
5512
5513var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );

Callers 2

showHideFunction · 0.70
defaultPrefilterFunction · 0.70

Calls 2

actualDisplayFunction · 0.70
jQueryFunction · 0.70

Tested by

no test coverage detected