Closed Bug 31059 Opened 25 years ago Closed 23 years ago

css @media screws up js cssRules[i] access

Categories

(Core :: DOM: CSS Object Model, defect, P3)

x86
Windows NT
defect

Tracking

()

RESOLVED DUPLICATE of bug 79818
Future

People

(Reporter: andreas, Assigned: jst)

References

()

Details

(Keywords: dom2)

Attachments

(2 files)

From Bugzilla Helper: User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; QXW0330d) BuildID: 2000022820 When iterating over all rules in a stylesheet execution stops where a @media rule appears. I'm not shure what the CSS2 or DOM2 spec says about this, but the current behaviour is quite weird. See HTML Testcase. An @media rule in a stylesheet also seems to block js access to ANY rule in that stylesheet. Reproducible: Always Steps to Reproduce: Run HTML testcase from Additional Information <html> <head> <style> .s0r0 { color: red; } </style> <style> .s1r0 { color: green; } @media print { .s1r1 { color: yellow; } } .s1r2 { color: blue; } </style> <style> .s2r0 { color: purple; } </style> </head> <!--===============================================================--> <body> <p class="s0r0">effect of s0r0</p> <p class="s1r0">effect of s1r0</p> <p class="s1r1">effect of s1r1</p> <p class="s1r2">effect of s1r2</p> <p class="s2r0">effect of s2r0</p> <script> <!-- function showStylesheets() { --> doc
HTML testcase was too long for entry from. Moved it to http://www.ars.ethz.ch/andreas/CssAtMediaProblem.htm
andreas@fh-konstanz.de - what is the expected behaviour here? I see colours everywhere except the one that should be yellow. Or should it be yellow? I don't know... Gerv
The original testcase was invalid because it attempted to access the selectorText property of a CSSMediaRule, and the property only exists for CSSStyleRules. However, this is still a bug. Accessing a CSSMediaRule in any way (well, I presume it's a CSSMediaRule) throws: JavaScript error: line 0: uncaught exception: [Exception... "Component does not have requested interface" code: "-2147467262" nsresult: "0x80004002 (NS_NOINTERFACE)" location: "file:///home/david/webtest/bug31059.html Line: 40"] Confirming bug.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Nominating for beta2 and reassigning to me.
Assignee: vidur → jst
Keywords: nsbeta2
Whiteboard: [nsbeta2-]
This is not mandatory for beta2.
This bug has been marked "future" because the original netscape engineer working on this is over-burdened. If you feel this is an error, that you or another known resource will be working on this bug,or if it blocks your work in some way -- please attach your concern to the bug for reconsideration.
Status: NEW → ASSIGNED
Keywords: nsbeta2
Whiteboard: [nsbeta2-]
Target Milestone: --- → Future
The origin of the bug is the non implementation of nsIDOMCSSRule in all css rules but StyleRule. Correct access to cssRules[i] (or cssRules.item(i)) is needed for stylesheet manipulation in the editor.
Keywords: dom2
Component: DOM Level 2 → DOM Style
Taking QA Contact on all open or unverified DOM Style bugs...
QA Contact: vidur → ian
Nominating this bug for nsbeta1 on behalf of gerardok@netscape.com.
Keywords: nsbeta1
Working on the assumption that this bug is caused by the lack of implementation of CSSMediaRule, and the fact that CSSMediaRule is not supposed to be implemented at the moment, removing nsbeta1 nomination.
Keywords: nsbeta1
bz, will your work on nsIDOMCSSMediaRule fix this bug as well?
Er.... actually I fixed this a while back. The attached testcase (corrected one) worksforme with a current trunk build. Marking duplicate of the bug that has the patch that fixed this ("CSSNameSpaceRuleImpl and othes in nsCSSRules.cpp do not implement nsIDOMCSSRule"). *** This bug has been marked as a duplicate of 79818 ***
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: