MCPcopy Create free account
hub / github.com/nwutils/nw-sample-apps / defaultDisplay

Function defaultDisplay

camera/jquery.js:5482–5511  ·  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

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

Callers 2

showHideFunction · 0.70
defaultPrefilterFunction · 0.70

Calls 2

actualDisplayFunction · 0.85
jQueryFunction · 0.70

Tested by

no test coverage detected