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 Sep 30, 2012
1 parent 22fac5c commit 9ced0274653b8b17ceb6b0675e2ae05433dcf202
Showing with 11 additions and 2 deletions.
  1. +3 −1 src/css.js
  2. +7 −0 test/unit/css.js
  3. +1 −1 test/unit/effects.js
@@ -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.
You can’t perform that action at this time.