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

Function actualDisplay

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

Source from the content-addressed store, hash-verified

6007 */
6008// Called only from within defaultDisplay
6009function actualDisplay( name, doc ) {
6010 var style,
6011 elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
6012
6013 // getDefaultComputedStyle might be reliably used only on attached element
6014 display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ?
6015
6016 // Use of this method is a temporary fix (more like optmization) until something better comes along,
6017 // since it was removed from specification and supported only in FF
6018 style.display : jQuery.css( elem[ 0 ], "display" );
6019
6020 // We don't have any data stored on the element,
6021 // so use "detach" method as fast way to get rid of the element
6022 elem.detach();
6023
6024 return display;
6025}
6026
6027/**
6028 * 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