mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Fix #12537, element.css('filter') returns undefined in IE9. Close gh-942.
This commit is contained in:
parent
22fac5c2e4
commit
9ced027465
@ -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,
|
||||
|
2
test/unit/effects.js
vendored
2
test/unit/effects.js
vendored
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user