]> source.dussan.org Git - jquery.git/commitdiff
Unit test for #6652 416/head
authorCorey Frang <gnarf@gnarf.net>
Thu, 14 Jul 2011 03:54:25 +0000 (22:54 -0500)
committerCorey Frang <gnarf@gnarf.net>
Thu, 14 Jul 2011 03:54:25 +0000 (22:54 -0500)
test/data/testsuite.css
test/index.html
test/unit/css.js

index 295740f5c343781cad8396b0a07eee1e9e632cf5..8c88a9334863448dba1a9fedad063d9f2d48cb06 100644 (file)
@@ -121,3 +121,5 @@ dfn { display: none; }
 /* #9239 Attach a background to the body( avoid crashes in removing the test element in support ) */
 body, div { background: url(http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif) no-repeat -1000px 0; }
 
+/* #6652 REMOVE FILTER:ALPHA(OPACITY=100) AFTER ANIMATION */
+#t6652 div { filter: alpha(opacity=50); }
index 4b4c98552e7da5f5a469773415e4572fa2b97076..93d2209d073c68430564411e7bafaff910e079e3 100644 (file)
@@ -226,6 +226,9 @@ Z</textarea>
                        <div id="t2037">
                                <div><div class="hidden">hidden</div></div>
                        </div>
+                       <div id="t6652">
+                               <div></div>
+                       </div>
                </div>
 
                <div id="tabindex-tests">
index f421f7bd4bc54b451149c3b1ec358f0d2cf1e74f..c01acdd685028ec82091829fe7f57885ed83d7d2 100644 (file)
@@ -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() {