Summary: | insertRule() throws CSS SYNTAX_ERR exception if no CSS declarations are included | ||
---|---|---|---|
Product: | [Applications] konqueror | Reporter: | Conrad Irwin <conrad.irwin> |
Component: | khtml | Assignee: | Konqueror Bugs <konqueror-bugs-null> |
Status: | RESOLVED UNMAINTAINED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version First Reported In: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Debian testing | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Conrad Irwin
2008-06-27 12:05:15 UTC
A bunch of things wrong here here: 1) ruleset: parsing returns 0 for {}, not an empty CSSStyleRuleImpl. I don't think that's correct CSS OM-wise, really. 2) We can't tell an empty parse from a parse error. Of course, given the forward compat stuff, one would have to tell the recoverable errors from non-recoverable... Don't know about CSS parser enough to do it myself. More detailed testcase, also shows a seeming IceWeasel 3 bug (which might not be a bug based on details of forward-compatible parsing rule): <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>insertRule test</title> <style type="text/css">/*empty stylesheet*/</style> </head> <script> function tryAdd(css) { try { document.styleSheets[0].insertRule(css, 0); alert("Add of " + css + " ok, length now:" + document.styleSheets[0].cssRules.length); } catch (e) { alert("Add of " + css + " failed with exception:" + e); } } function test() { tryAdd("body {font-weight: bold; }"); tryAdd("body {}"); tryAdd("xyz"); tryAdd("{"); tryAdd("foo{"); tryAdd("@export"); } </script> <body onload="test()"> Minimal test </html> Thank you for the bug report. As this report hasn't seen any changes in 10 years or more, we ask if you can please confirm that the issue still persists. If this bug is no longer persisting or relevant please change the status to resolved. Dear user, KHTML (and KJS) was a long time more or less unmaintained and got removed in KF6. Please migrate to use a QWebEngine based HTML component. We will do no further fixes or improvements to the KF5 branches of these components beside important security fixes. For security issues, please see: https://kde.org/info/security/ Sorry that we did not fix this issue during the life-time of KHTML. Greetings Christoph Cullmann |