Ticket #4427 (closed bug: fixed)
jQuery.css(name) returns inconsistent results
|Reported by:||skyde||Owned by:|
jQuery.css(name) returns inconsistent results depending on whether name is written camel-cased or hyphened, when !important style rules apply.
1) add a !important style rule to an element, for example background-color: #000 !important
2) change the property with jQuery, for example $(element).css('background-color', '#fff');
3) $(element).css('background-color') returns now #000, while $(element).css('backgroundColor') returns differently #fff
Firefox 3.0.7, Opera 9.52 and IE7 were tested to work this way, on webkit-based browsers (Safari 4 and Chrome 1 tested) $(element).css() overrides !important rules with both writing styles.
I don't know which one is the correct way (styles applied with $.css can be seen as inline styles, in which case they should be overridden by !important rules), but $.css should return consistent values in any case, not depending on writing style :)
See attachment for tests.
- Priority changed from minor to undecided
- Status changed from new to open
- Component changed from core to css
- Milestone 1.4 deleted
- Status changed from open to closed
- Resolution set to fixed