zoltan-dulac / cssSandpaper

a CSS3 Polyfill that implements CSS3 transforms, box-shadow, gradients, opacity and RGBA/HSL/HSLA colours in browser that don't support them.
http://www.useragentman.com/blog/csssandpaper-a-css3-javascript-library/
208 stars 47 forks source link

document.body.filters causing "Unespecified error." #7

Open pequalsmp opened 12 years ago

pequalsmp commented 12 years ago

First off thank you for this great solution to a painful problem with old IEs, but in IE document.body.filters are returning "Unspecified error." and thus can't be checked to see if they are undefined.

zoltan-dulac commented 12 years ago

Do you have a page where this problem manifests itself? If so, I may be able to fix this issue.

Thanks in advance, Zoltan.

wuservices commented 12 years ago

Are you still having this issue? I've run into a similar issue but possibly unrelated. IE8 (maybe others) throws an unspecified error on obj.filters.item('DXImageTransform.Microsoft.Matrix') in cssSandpaper. However, I've found a possible workaround and wanted to share in case it helps you or provides Zoltan with any ideas.

I'll try to get an isolated test case going if possible - I'm not sure if the issue will manifest itself outside of my app.

I have a bunch of Backbone.js code that initializes views when my app starts up. In one of my view's constructors, I call a method to update the rotation.

Previously I would just call this.updateRotation();, however I noticed that rotation would work after the app was initialized so I tried to introduce a delay. Oddly enough, adding a delay of 0 seems to fix the issue at least at first glance: setTimeout(this.updateRotation, 0);.

For reference, here's updateRotation: cssSandpaper.setTransform(this.$img.get(0), 'rotate(' + this.model.get('rotation') + 'deg)');