MCPcopy Create free account
hub / github.com/tree-sitter/tree-sitter-javascript / actualDisplay

Function actualDisplay

examples/jquery.js:5460–5476  ·  view source on GitHub ↗
( name, doc )

Source from the content-addressed store, hash-verified

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

Callers 1

defaultDisplayFunction · 0.85

Calls 1

jQueryFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…