WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WONTFIX
12527
"class" doesn't work as a JS var
https://bugs.webkit.org/show_bug.cgi?id=12527
Summary
"class" doesn't work as a JS var
Darin Fisher (:fishd, Google)
Reported
2007-02-01 00:50:14 PST
class selector doesn't work dynamically testcase coming up...
Attachments
testcase
(663 bytes, text/html)
2007-02-01 00:52 PST
,
Darin Fisher (:fishd, Google)
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Darin Fisher (:fishd, Google)
Comment 1
2007-02-01 00:52:30 PST
Created
attachment 12851
[details]
testcase
Dave Hyatt
Comment 2
2007-02-01 02:28:43 PST
This actually has nothing to do with CSS, which works fine. The issue is with JavaScript, which is not allowing the use of the word "class" as a variable name. The JS console reports a parse error on that line.
Alexey Proskuryakov
Comment 3
2007-02-01 06:46:29 PST
*** This bug has been marked as a duplicate of
6179
***
Darin Adler
Comment 4
2007-02-01 10:15:26 PST
How can this be a duplicate of a bug that's fixed? I guess the issue here is that class works in Firefox, but not Windows IE.
Maciej Stachowiak
Comment 5
2007-02-01 11:11:16 PST
Yes, it's not a duplicate. We might not want to fix it though, since IE still treats "class" as a future keyword.
Geoffrey Garen
Comment 6
2007-02-01 12:27:05 PST
In
bug 6179
, I chose to follow WinIE rather than Mozilla, and reserve 'class'. Is there a compelling real-world example that justifies unreserving 'class'?
Alexey Proskuryakov
Comment 7
2007-02-01 12:30:36 PST
(In reply to
comment #4
)
> How can this be a duplicate of a bug that's fixed?
This was the original issue reported in
bug 6179
, but the bug was re-purposed after it was decided that it was invalid. Since
bug 6179
contains the rationale for our behavior in this case, I marked this as a duplicate.
Darin Fisher (:fishd, Google)
Comment 8
2007-03-17 12:23:48 PDT
so, should this be closed as WONTFIX then?
Timothy Churchward
Comment 9
2008-11-02 17:25:27 PST
Personally I'm fine with being stricter with the "class" keyword ... but I can definitely see the argument for not allowing it. However, maybe instead of a Parse Error it should be a console warning? Furthermore, in using the new Debug Inspector if a JavaScript contains the someObject.class or var class WebKit seems to crash after a few seconds.
Alexey Proskuryakov
Comment 10
2008-11-03 01:19:51 PST
(In reply to
comment #9
)
> Furthermore, in using the new Debug Inspector if a JavaScript contains the > someObject.class or var class WebKit seems to crash after a few seconds.
Could you please file a new bug for this?
Timothy Churchward
Comment 11
2008-11-04 20:54:30 PST
(In reply to
comment #10
)
> Could you please file a new bug for this?
Good call, please see
https://bugs.webkit.org/show_bug.cgi?id=22046
Gavin Barraclough
Comment 12
2011-06-15 00:03:36 PDT
Per the ES5 spec, class is not a reserved word. This is definitely now correct behaviour.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug