diff options
author | Corey Frang <gnarf@gnarf.net> | 2011-07-13 22:54:25 -0500 |
---|---|---|
committer | Corey Frang <gnarf@gnarf.net> | 2011-07-13 22:54:25 -0500 |
commit | 5b0c3060f0f55d39d2251d4f79be58570c5ba029 (patch) | |
tree | 108c6002f6124227c916be85def0d3adef95de12 /test/unit | |
parent | d1c4f0e0d19da3478640bdff64a4c419683553a8 (diff) | |
download | jquery-5b0c3060f0f55d39d2251d4f79be58570c5ba029.tar.gz jquery-5b0c3060f0f55d39d2251d4f79be58570c5ba029.zip |
Unit test for #6652
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/css.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/unit/css.js b/test/unit/css.js index f421f7bd4..c01acdd68 100644 --- a/test/unit/css.js +++ b/test/unit/css.js @@ -259,6 +259,23 @@ if ( !jQuery.support.opacity ) { 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" ); }); + + test( "Setting opacity to 1 properly removes filter: style (#6652)", function() { + var rfilter = /filter:[^;]*/i, + test = jQuery( "#t6652" ).css( "opacity", 1 ), + test2 = test.find( "div" ).css( "opacity", 1 ); + + function hasFilter( elem ) { + var match = rfilter.exec( elem[0].style.cssText ); + if ( match ) { + return true; + } + return false; + } + expect( 2 ); + ok( !hasFilter( test ), "Removed filter attribute on element without filter in stylesheet" ); + ok( hasFilter( test2 ), "Filter attribute remains on element that had filter in stylesheet" ); + }); } test("css(String, Function)", function() { |