Skip to content
Permalink
Browse files
Fix #12537, element.css('filter') returns undefined in IE9. Close gh-942
.
  • Loading branch information
mikesherov authored and dmethvin committed Oct 1, 2012
1 parent 22fac5c commit 9ced027
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
@@ -290,7 +290,9 @@ if ( window.getComputedStyle ) {

if ( computed ) {

ret = computed[ name ];
// getPropertyValue is only needed for .css('filter') in IE9, see #12537
ret = computed.getPropertyValue( name ) || computed[ name ];

if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
ret = jQuery.style( elem, name );
}
@@ -782,6 +782,13 @@ test("certain css values of 'normal' should be convertable to a number, see #862
ok( jQuery.isNumeric( parseFloat( el.css("fontWeight") ) ), "css('fontWeight') not convertable to number, see #8627" );
});

// only run this test in IE9
if ( document.documentMode === 9 ) {
test( ".css('filter') returns a string in IE9, see #12537", 1, function() {
equal( jQuery("<div style='-ms-filter:\"progid:DXImageTransform.Microsoft.gradient(startColorstr=#FFFFFF, endColorstr=#ECECEC)\";'></div>").css("filter"), "progid:DXImageTransform.Microsoft.gradient(startColorstr=#FFFFFF, endColorstr=#ECECEC)", "IE9 returns the correct value from css('filter')." );
});
}

test( "cssHooks - expand", function() {
expect( 15 );
var result,
@@ -1689,7 +1689,7 @@ asyncTest( "non-px animation handles non-numeric start (#11971)", 2, function()
var foo = jQuery("#foo"),
initial = foo.css("backgroundPositionX");

if ( initial == null ) {
if ( !initial ) {
expect(1);
ok( true, "Style property not understood" );
start();

0 comments on commit 9ced027

Please sign in to comment.