Side navigation
#5790 closed bug (duplicate)
Opened January 12, 2010 07:54PM UTC
Closed October 15, 2010 09:04PM UTC
Last modified March 14, 2012 12:30AM UTC
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: | |
Blocked by: | Blocking: |
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);
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.