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

Function actualDisplay

2.1.1/src/css/defaultDisplay.js:15–31  ·  view source on GitHub ↗
( name, doc )

Source from the content-addressed store, hash-verified

13 */
14// Called only from within defaultDisplay
15function actualDisplay( name, doc ) {
16 var style,
17 elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
18
19 // getDefaultComputedStyle might be reliably used only on attached element
20 display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ?
21
22 // Use of this method is a temporary fix (more like optimization) until something better comes along,
23 // since it was removed from specification and supported only in FF
24 style.display : jQuery.css( elem[ 0 ], "display" );
25
26 // We don't have any data stored on the element,
27 // so use "detach" method as fast way to get rid of the element
28 elem.detach();
29
30 return display;
31}
32
33/**
34 * Try to determine the default display value of an element

Callers 1

defaultDisplayFunction · 0.70

Calls 1

jQueryFunction · 0.50

Tested by

no test coverage detected