Closed Bug 332490 Opened 14 years ago Closed 3 years ago

nsCSSStyleSheet::InsertRule shouldn't spam Error Console

Categories

(Core :: CSS Parsing and Computation, defect, P5, minor)

x86
Windows XP
defect

Tracking

()

RESOLVED WONTFIX
Future

People

(Reporter: gaubugzilla, Unassigned)

References

Details

(Keywords: testcase)

Attachments

(1 file)

I was trying to implement CSS selector validation using CSSStyleSheet.insertRule(). Unfortunately it didn't work out - for wrong selectors this function will throw a JavaScript exception (which can be intercepted) *and* write an error message to JavaScript Console (which cannot). IMO the latter shouldn't happen, an exception is already enough.
Attached file Testcase
This testcase will show a JavaScript error message because an invalid selector is added. It shouldn't write anything to the JavaScript Console - but currently it does.
Keywords: testcase
Severity: normal → minor
Status: NEW → ASSIGNED
Priority: -- → P5
Target Milestone: --- → Future
This probably requires implementing error-reporting suppression.  I'm not even sure if that's a good idea, since I think only a subset of errors would actually trigger the code that causes an exception; some errors are just handled according to the CSS error-handling rules, and some errors like having multiple rules in the string would just be handled as well.
Summary: nsCSSStyleSheet::InsertRule shouldn't spam JavaScript Console → nsCSSStyleSheet::InsertRule shouldn't spam Error Console
Assignee: dbaron → nobody
Status: ASSIGNED → NEW
QA Contact: ian → style-system
Blocks: abp
I just checked attached test-case out of curiosity and there were no error messages in the console. So, it might be considered as already fixed. Am I wrong?
There is still a CSS warning: "Dangling combinator.  Ruleset ignored due to bad selector." Console evolved and allows filtering out CSS messages by now, maybe that happened in your case. But more importantly, there is document.querySelector() API which will no longer produce any messages beyond the exception - so silent validation of CSS selectors is no longer an issue.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.