Ticket #5790 (closed bug: duplicate)
semicolon in css object value crashes webkit and ie
| Reported by: | PSS | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 1.4 |
| Component: | css | Version: | 1.3.2 |
| Keywords: | CSS OBJECT | Cc: | |
| Blocking: | Blocked by: |
Description
Crashes both jquery-1.3.2 and 1.4 alpha 2 in IE 8 and Webkit. I know it's bad syntax, but ; should be ignored by parser. It was pretty hard to guess where the bug was :)
jquery-1.4a2 gives "Line: 4140 Error: Invalid property value."
EXAMPLE:
var some_css = {
'background-color' : '#f0f0f0;', 'font-weight' : 'bold', 'color' : '#ff0000'
}
jQuery('.myselector').css(some_css);
This works ok (no ; ):
var some_css = {
'background-color' : '#f0f0f0', 'font-weight' : 'bold', 'color' : '#ff0000'
}
jQuery('.myselector').css(some_css);
Change History
comment:1 Changed 3 years ago by addyosmani
- need changed from Review to Patch
- Priority changed from major to low
- Component changed from core to css
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Using jQuery 1.3.2 (and also 1.4.2) I ran this test in a few different browsers (relative to what you mentioned in your ticket).
The results were WebKit (works fine), Safari 5.02 (works fine), Chrome 6.04 (works fine), IE8 (error).
It would appear that we need to add a special case to avoid this issue breaking in IE, however, given that a relatively low number of developers would incorrectly use this syntax on purpose, I am assigning it a low patch priority for now.