Skip to content
Permalink
Browse files

Make sure setting opacity does not clobber other inline filters. Fixe…

…s #7101.
  • Loading branch information
Colin Snover authored and jeresig committed Sep 30, 2010
1 parent cb811c0 commit 06c505d85194890f8bacabc66895a6167b61728a
Showing with 7 additions and 4 deletions.
  1. +1 −1 src/css.js
  2. +6 −3 test/unit/css.js
@@ -204,7 +204,7 @@ if ( !jQuery.support.opacity ) {

style.filter = ralpha.test(filter) ?
filter.replace(ralpha, opacity) :
opacity;
style.filter + ' ' + opacity;
}
};
}
@@ -114,11 +114,14 @@ if(jQuery.browser.msie) {

var filterVal = "progid:DXImageTransform.Microsoft.Alpha(opacity=30) progid:DXImageTransform.Microsoft.Blur(pixelradius=5)";
var filterVal2 = "progid:DXImageTransform.Microsoft.alpha(opacity=100) progid:DXImageTransform.Microsoft.Blur(pixelradius=5)";
var filterVal3 = "progid:DXImageTransform.Microsoft.Blur(pixelradius=5)";
jQuery('#foo').css("filter", filterVal);
equals( jQuery('#foo').css("filter"), filterVal, "css('filter', val) works" );
jQuery('#foo').css("opacity", 1)
equals( jQuery('#foo').css("filter"), filterVal2, "Setting opacity in IE doesn't clobber other filters" );
equals( jQuery('#foo').css("opacity"), 1, "Setting opacity in IE with other filters works" )
jQuery('#foo').css("opacity", 1);
equals( jQuery('#foo').css("filter"), filterVal2, "Setting opacity in IE doesn't duplicate opacity filter" );
equals( jQuery('#foo').css("opacity"), 1, "Setting opacity in IE with other filters works" );
jQuery('#foo').css("filter", filterVal3).css("opacity", 1);
ok( jQuery('#foo').css("filter").indexOf(filterVal3) !== -1, "Setting opacity in IE doesn't clobber other filters" );
});
}

0 comments on commit 06c505d

Please sign in to comment.
You can’t perform that action at this time.