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

Function actualDisplay

2.1.1/test/jquery-2.1.1.js:5459–5475  ·  view source on GitHub ↗
( name, doc )

Source from the content-addressed store, hash-verified

5457 */
5458// Called only from within defaultDisplay
5459function actualDisplay( name, doc ) {
5460 var style,
5461 elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
5462
5463 // getDefaultComputedStyle might be reliably used only on attached element
5464 display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ?
5465
5466 // Use of this method is a temporary fix (more like optmization) until something better comes along,
5467 // since it was removed from specification and supported only in FF
5468 style.display : jQuery.css( elem[ 0 ], "display" );
5469
5470 // We don't have any data stored on the element,
5471 // so use "detach" method as fast way to get rid of the element
5472 elem.detach();
5473
5474 return display;
5475}
5476
5477/**
5478 * Try to determine the default display value of an element

Callers 1

defaultDisplayFunction · 0.70

Calls 1

jQueryFunction · 0.70

Tested by

no test coverage detected