Closed
Bug 62613
Opened 24 years ago
Closed 23 years ago
CSSStyleDeclaration doesn't support array access for item() method
Categories
(Core :: DOM: CSS Object Model, defect, P3)
Core
DOM: CSS Object Model
Tracking
()
RESOLVED
FIXED
mozilla0.9.4
People
(Reporter: david, Assigned: jst)
Details
(Keywords: dom2, Whiteboard: [FIXED ON TRUNK], need a=?)
Attachments
(3 files)
819 bytes,
text/html
|
Details | |
2.03 KB,
patch
|
Details | Diff | Splinter Review | |
815 bytes,
patch
|
harishd
:
review+
jst
:
superreview+
asa
:
approval+
|
Details | Diff | Splinter Review |
The CSSStyleDeclaration interface has an item(int) method, which means that CSSStyleDeclaration objects should behave like arrays. But they don't, as demonstrated by the following code: <head> <style> P { color: red } </style> </head> <body> <script> var rule = document.styleSheets[0].cssRules[0]; // Bug: this should display "P { color: red }" document.write("<p>rule.cssText: " + rule.cssText); // Bug: this should display "P" document.write("<p>rule.selectorText: " + rule.selectorText); // Bug: this should return "color: red" document.write("<p>rule.style.cssText: " + rule.style.cssText); // Bug: this should work like calling item() document.write("<p>rule.style[0]: " + rule.style[0]); document.write("<p>rule.style.item(0): " + rule.style.item(0)); </script> </body>
Assignee | ||
Comment 2•24 years ago
|
||
Thanks for the testcase, could you put that in a file and attach it to this bug, that way it's even easier for me to work on this once I get to this. This is not serious enough to get any attention for the next release tho so I'm futuring this for now.
Status: NEW → ASSIGNED
OS: Linux → All
Hardware: PC → All
Target Milestone: --- → Future
Reporter | ||
Comment 3•24 years ago
|
||
Reporter | ||
Comment 4•24 years ago
|
||
Made the testcase into an attachment, per JST's request. I don't know when the next release is scheduled for, so I won't disupute the assertion that it isn't important enough. However, at a minimum, I think that the DOMImplementation class should be changed to stop reporting that it supports the "CSS" feature, since this bug, along with 62607, 62611, and 62612 make it seem kind of broken. I'll submit a separate bug for that.
Updated•24 years ago
|
Component: DOM Level 2 → DOM Style
Comment 5•24 years ago
|
||
Taking QA Contact on all open or unverified DOM Style bugs...
QA Contact: vidur → ian
Comment 6•23 years ago
|
||
Comment 7•23 years ago
|
||
Attached patch changes the scriptable flags for nsCSSStyleDeclSH from DOM_DEFAULT_FLAGS to ARRAY_SCRIPTABLE_FLAGS and implements nsCSSStyleDeclSH::GetProperty(). I didn't call the security manager because I didn't see any compelling reason to do so for style sheets. jst, your class info stuff RULES!
Assignee | ||
Comment 8•23 years ago
|
||
Fabian, cool, but I think you went a bit too far here :-) You should only need to change the flags, the rest should work as is.
Comment 9•23 years ago
|
||
LOL, I just copied the patch you did for nsHistorySH ;-) New patch coming up.
Assignee | ||
Comment 10•23 years ago
|
||
I figured as much :-)
Assignee | ||
Updated•23 years ago
|
Attachment #47732 -
Flags: needs-work+
Comment 11•23 years ago
|
||
Assignee | ||
Comment 12•23 years ago
|
||
Comment on attachment 47850 [details] [diff] [review] Change DOM_DEFAULT_SCRIPTABLE_FLAGS to ARRAY_SCRIPTABLE_FLAGS sr=jst
Attachment #47850 -
Flags: superreview+
Assignee | ||
Comment 13•23 years ago
|
||
Pulling back to 0.9.4, there's absolutely no reason to not check this in.
Target Milestone: Future → mozilla0.9.4
Comment 14•23 years ago
|
||
Comment on attachment 47850 [details] [diff] [review] Change DOM_DEFAULT_SCRIPTABLE_FLAGS to ARRAY_SCRIPTABLE_FLAGS r=harishd
Attachment #47850 -
Flags: review+
Updated•23 years ago
|
Whiteboard: [HAVE FIX] → [HAVE FIX], need a=?
Assignee | ||
Comment 15•23 years ago
|
||
Fix checked in on the trunk.
Whiteboard: [HAVE FIX], need a=? → [FIXED ON TRUNK], need a=?
Comment 16•23 years ago
|
||
Comment on attachment 47850 [details] [diff] [review] Change DOM_DEFAULT_SCRIPTABLE_FLAGS to ARRAY_SCRIPTABLE_FLAGS a=asa on behalf of drivers for checkin to the 0.9.4 branch.
Attachment #47850 -
Flags: approval+
Assignee | ||
Comment 17•23 years ago
|
||
Fix checekd in on the branch too.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•