MCPcopy Index your code
hub / github.com/sql-js/sql.js / css_defaultDisplay

Function css_defaultDisplay

documentation/javascript/application.js:7739–7779  ·  view source on GitHub ↗
( nodeName )

Source from the content-addressed store, hash-verified

7737
7738// Try to determine the default display value of an element
7739function css_defaultDisplay( nodeName ) {
7740 if ( elemdisplay[ nodeName ] ) {
7741 return elemdisplay[ nodeName ];
7742 }
7743
7744 var elem = jQuery( "<" + nodeName + ">" ).appendTo( document.body ),
7745 display = elem.css("display");
7746 elem.remove();
7747
7748 // If the simple way fails,
7749 // get element's real default display by attaching it to a temp iframe
7750 if ( display === "none" || display === "" ) {
7751 // Use the already-created iframe if possible
7752 iframe = document.body.appendChild(
7753 iframe || jQuery.extend( document.createElement("iframe"), {
7754 frameBorder: 0,
7755 width: 0,
7756 height: 0
7757 })
7758 );
7759
7760 // Create a cacheable copy of the iframe document on first call.
7761 // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
7762 // document to it; WebKit & Firefox won't allow reusing the iframe document.
7763 if ( !iframeDoc || !iframe.createElement ) {
7764 iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
7765 iframeDoc.write("<!doctype html><html><body>");
7766 iframeDoc.close();
7767 }
7768
7769 elem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) );
7770
7771 display = curCSS( elem, "display" );
7772 document.body.removeChild( iframe );
7773 }
7774
7775 // Store the correct default display
7776 elemdisplay[ nodeName ] = display;
7777
7778 return display;
7779}
7780
7781jQuery.each([ "height", "width" ], function( i, name ) {
7782 jQuery.cssHooks[ name ] = {

Callers 2

showHideFunction · 0.85
defaultPrefilterFunction · 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…