#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: | |
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);
Change History (3)
comment:1 Changed 10 years ago by
Component: | core → css |
---|---|
need: | Review → Patch |
Priority: | major → low |
comment:2 Changed 10 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Errors related to invalid CSS properties in IE were resolved in 1.4.3.
Note: See
TracTickets for help on using
tickets.
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.