Ticket #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 | |
| Blocking: | Blocked by: |
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
comment:2 Changed 9 months ago by dmethvin
- Cc mikesherov added
- Priority changed from undecided to blocker
- Status changed from new to open
- Component changed from unfiled to css
- Milestone changed from None to 1.8.2
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.
comment:3 Changed 9 months ago by mikesherov
- Owner set to mikesherov
- Status changed from open to assigned
Whatever ends up smaller. Thanks for the test case Dave.
comment:5 Changed 9 months ago by Mike Sherov
- Status changed from assigned to closed
- Resolution set to fixed
Fix #12537, element.css('filter') returns undefined in IE9. Close gh-942.
Changeset: 9ced0274653b8b17ceb6b0675e2ae05433dcf202
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

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