) + "px";
}
-
// Try to determine the default display value of an element
function css_defaultDisplay( nodeName ) {
- var elem,
- doc = document,
+ var doc = document,
display = elemdisplay[ nodeName ];
if ( !display ) {
- elem = jQuery( doc.createElement( nodeName ) );
- display = curCSS( elem.appendTo( doc.body )[0], "display" );
- elem.remove();
+ display = actualDisplay( nodeName, doc );
// If the simple way fails, read from inside an iframe
if ( display === "none" || !display ) {
doc.write("<!doctype html><html><body>");
doc.close();
- elem = jQuery( doc.createElement( nodeName ) );
- display = curCSS( elem.appendTo( doc.body )[0], "display" );
- elem.remove();
+ display = actualDisplay( nodeName, doc );
iframe.detach();
}
return display;
}
+// Called ONLY from within css_defaultDisplay
+function actualDisplay( name, doc ) {
+ var elem, display;
+ elem = jQuery( doc.createElement( name ) );
+ display = curCSS( elem.appendTo( doc.body )[0], "display" );
+ elem.remove();
+ return display;
+}
+
jQuery.each([ "height", "width" ], function( i, name ) {
jQuery.cssHooks[ name ] = {
get: function( elem, computed, extra ) {
// if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
// if value === "", then remove inline opacity #12685
if ( ( value >= 1 || value === "" ) &&
- jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
+ jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
style.removeAttribute ) {
// Setting style.filter to null, "" & " " still leave "filter:" in the cssText