Bug Tracker

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#12537 closed bug (fixed)

element.css('filter') returns undefined in IE9

Reported by: macagp@… Owned by: mikesherov
Priority: blocker Milestone: 1.8.3
Component: css Version: 1.8.0
Keywords: Cc: mikesherov
Blocked by: Blocking:

Description

The following returns undefined in Internet Explorer 9 (IE8 works fine) using jQuery 1.8+ but works in jQuery 1.7.

<style type="text/css">
	div{
		background-color:#F4F4F4;
		background:-webkit-gradient(linear,0% 100%,0% 0,from(#FFFFFF),to(#ECECEC));
		background:-webkit-linear-gradient(top,#FFFFFF,#ECECEC);
		background:-moz-linear-gradient(top,#FFFFFF,#ECECEC);
		-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#FFFFFF, endColorstr=#ECECEC)";background:-ms-linear-gradient(top,#FFFFFF,#ECECEC);background:-o-linear-gradient(top,#FFFFFF,#ECECEC);
		height: 400px;
	}
</style>

<script type="text/javascript">
	$(function(){
		alert($('div').css('filter'));
	});
</script>

Change History (7)

comment:1 Changed 5 years ago by macagp@…

Here is the jsFiddle: http://jsfiddle.net/d5beX/

comment:2 Changed 5 years ago by dmethvin

Cc: mikesherov added
Component: unfiledcss
Milestone: None1.8.2
Priority: undecidedblocker
Status: newopen

Moar test case: http://jsfiddle.net/d5beX/5/

It seems that even though the CSS specifies -ms-filter, the property in .css() must be specified as filter. Plus, it has to be grabbed via computed.getPropertyValue("filter") and not computed["filter"]. Not sure if we just need a cssHook for this one case or whether we should be using .getPropertyValue everywhere.

Since this is a regression I'll mark it as 1.8.2 blocker but it may be pushed to 1.9.

Last edited 5 years ago by dmethvin (previous) (diff)

comment:3 Changed 5 years ago by mikesherov

Owner: set to mikesherov
Status: openassigned

Whatever ends up smaller. Thanks for the test case Dave.

comment:5 Changed 5 years ago by Mike Sherov

Resolution: fixed
Status: assignedclosed

Fix #12537, element.css('filter') returns undefined in IE9. Close gh-942.

Changeset: 9ced0274653b8b17ceb6b0675e2ae05433dcf202

comment:6 Changed 5 years ago by mikesherov

Milestone: 1.8.21.9

comment:7 Changed 5 years ago by dmethvin

Milestone: 1.91.8.3
Note: See TracTickets for help on using tickets.