mhemesath / r2d3

Raphael Rendered, Data Driven Documents
MIT License
546 stars 133 forks source link

style() on HTML elements doesn't work in IE7 #105

Closed sun16 closed 10 years ago

sun16 commented 11 years ago

http://jsfiddle.net/Cp52L/

The CSSStyleDeclaration shim (mentioned in #83) doesn't work for IE7. Thus r2d3 fails everywhere we call get/set/removeProperty (selection-style.js, transition-style.js). However, get/set/removeAttribute still works on the element.style objects just like IE8.

A proposed fix would be to replace all instances of get/set/removeProperty() with get/set/removeAttribute() respectively. BTW this would mean that the CSSStyleDeclaration shim isn't being used anymore.

mhemesath commented 11 years ago

I'm fine with this as long as it works in IE8 fine. Did you run the test suite?

sun16 commented 11 years ago

Yeah. I also added an example test for #103 which covers this case as well. (see commit https://github.com/sun16/r2d3/commit/948f4f2e60f4b8dfb22f61ef1a7016184a3d8d47)

mhemesath commented 11 years ago

Cool, can you create a pull request?

sun16 commented 10 years ago

Looks like #114 handles the styling setProperty case - there are a few cases of setProperty in transitions, and all removeProperty, that need to be wrapped in if checks as well.

sun16 commented 10 years ago

Resolved by pull request https://github.com/mhemesath/r2d3/pull/139