MCPcopy Create free account
hub / github.com/TruthHun/BookStack / defaultDisplay

Function defaultDisplay

static/wangEditor/js/lib/jquery-2.2.1.js:5603–5633  ·  view source on GitHub ↗

* Try to determine the default display value of an element * @param {String} nodeName

( nodeName )

Source from the content-addressed store, hash-verified

5601 * @param {String} nodeName
5602 */
5603function defaultDisplay( nodeName ) {
5604 var doc = document,
5605 display = elemdisplay[ nodeName ];
5606
5607 if ( !display ) {
5608 display = actualDisplay( nodeName, doc );
5609
5610 // If the simple way fails, read from inside an iframe
5611 if ( display === "none" || !display ) {
5612
5613 // Use the already-created iframe if possible
5614 iframe = ( iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" ) )
5615 .appendTo( doc.documentElement );
5616
5617 // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
5618 doc = iframe[ 0 ].contentDocument;
5619
5620 // Support: IE
5621 doc.write();
5622 doc.close();
5623
5624 display = actualDisplay( nodeName, doc );
5625 iframe.detach();
5626 }
5627
5628 // Store the correct default display
5629 elemdisplay[ nodeName ] = display;
5630 }
5631
5632 return display;
5633}
5634var rmargin = ( /^margin/ );
5635
5636var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );

Callers 2

showHideFunction · 0.70
defaultPrefilterFunction · 0.70

Calls 2

actualDisplayFunction · 0.70
jQueryFunction · 0.70

Tested by

no test coverage detected