IE6 will shrink-wrap elements with layout instead of allowing content to flow outside...
[jquery.git] / src / css.js
index 07ff686..8751860 100644 (file)
@@ -1,6 +1,6 @@
 (function( jQuery ) {
 
-var ralpha = /alpha\([^)]*\)/,
+var ralpha = /alpha\([^)]*\)/i,
        ropacity = /opacity=([^)]*)/,
        rdashAlpha = /-([a-z])/ig,
        rupper = /([A-Z])/g,
@@ -20,6 +20,11 @@ var ralpha = /alpha\([^)]*\)/,
        };
 
 jQuery.fn.css = function( name, value ) {
+       // Setting 'undefined' is a no-op
+       if ( arguments.length === 2 && value === undefined ) {
+               return this;
+       }
+
        return jQuery.access( this, name, value, true, function( elem, name, value ) {
                return value !== undefined ?
                        jQuery.style( elem, name, value ) :
@@ -199,7 +204,7 @@ if ( !jQuery.support.opacity ) {
 
                        style.filter = ralpha.test(filter) ?
                                filter.replace(ralpha, opacity) :
-                               opacity;
+                               style.filter + ' ' + opacity;
                }
        };
 }
@@ -275,14 +280,9 @@ function getWH( elem, name, extra ) {
 
 if ( jQuery.expr && jQuery.expr.filters ) {
        jQuery.expr.filters.hidden = function( elem ) {
-               var width = elem.offsetWidth, height = elem.offsetHeight,
-                       skip = elem.nodeName.toLowerCase() === "tr";
-
-               return width === 0 && height === 0 && !skip ?
-                       true :
-                       width > 0 && height > 0 && !skip ?
-                               false :
-                               (elem.style.display || jQuery.css( elem, "display" )) === "none";
+               var width = elem.offsetWidth, height = elem.offsetHeight;
+
+               return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && (elem.style.display || jQuery.css( elem, "display" )) === "none");
        };
 
        jQuery.expr.filters.visible = function( elem ) {