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

Function css_defaultDisplay

2.0.3/Css.js:429–458  ·  view source on GitHub ↗
(nodeName)

Source from the content-addressed store, hash-verified

427 // Try to determine the default display value of an element
428
429 function css_defaultDisplay(nodeName) {
430 var doc = document,
431 display = elemdisplay[nodeName];
432
433 if (!display) {
434 display = actualDisplay(nodeName, doc);
435
436 // If the simple way fails, read from inside an iframe
437 if (display === "none" || !display) {
438 // Use the already-created iframe if possible
439 iframe = (iframe ||
440 jQuery("<iframe frameborder='0' width='0' height='0'/>")
441 .css("cssText", "display:block !important")
442 ).appendTo(doc.documentElement);
443
444 // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
445 doc = (iframe[0].contentWindow || iframe[0].contentDocument).document;
446 doc.write("<!doctype html><html><body>");
447 doc.close();
448
449 display = actualDisplay(nodeName, doc);
450 iframe.detach();
451 }
452
453 // Store the correct default display
454 elemdisplay[nodeName] = display;
455 }
456
457 return display;
458 }
459
460 // Called ONLY from within css_defaultDisplay
461

Callers 1

showHideFunction · 0.70

Calls 2

actualDisplayFunction · 0.70
jQueryFunction · 0.70

Tested by

no test coverage detected