Skip to main content

Bug Tracker

Side navigation

#12537 closed bug (fixed)

Opened September 14, 2012 10:21AM UTC

Closed October 01, 2012 02:27AM UTC

Last modified October 01, 2012 04:42PM UTC

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

Reported by: macagp@gmail.com 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>
Attachments (0)
Change History (7)

Changed September 14, 2012 10:26AM UTC by macagp@gmail.com comment:1

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

Changed September 18, 2012 12:46AM UTC by dmethvin comment:2

_comment0: 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.1347929268130768
cc: → mikesherov
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.

Changed September 18, 2012 01:16AM UTC by mikesherov comment:3

owner: → mikesherov
status: openassigned

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

Changed September 30, 2012 09:48PM UTC by mikesherov comment:4

Changed October 01, 2012 02:27AM UTC by Mike Sherov comment:5

resolution: → fixed
status: assignedclosed

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

Changeset: 9ced0274653b8b17ceb6b0675e2ae05433dcf202

Changed October 01, 2012 12:17PM UTC by mikesherov comment:6

milestone: 1.8.21.9

Changed October 01, 2012 04:42PM UTC by dmethvin comment:7

milestone: 1.91.8.3