Version: (using KDE KDE 3.4.0) Installed from: SuSE RPMs OS: Linux When iterating over an element's .cssRules, sometimes not all items present in the page are in the list. This can happen if: * A rule contains no CSS properties * The rule contains only CSS properties unsupported by KHTML It may be useful to have these present, as a script may be adding the relevant valid properties to the rules.
Created attachment 11321 [details] Minimal testcase This testcase iterates over the various rules, and outputs their selectors. All five of the included selectors should be displayed, rather than the three which are. Additionally, the selector div:first-child is displayed incorrectly. I'm not sure if this is part of the same bug, or a separate one.
Created attachment 11515 [details] insertRule testcase I have now tracked down a similar problem with .insertRule which I suspect has the same underlying cause. Inserting a rule set which only contains a comment fails, giving a syntax error. The spec ( http://www.w3.org/TR/CSS21/syndata.html#q10 ) says "... In between there must be a list of zero or more semicolon-separated (;) declarations. ...", indicating that just having a comment should be fine. As the example stands, the error text doesn't appear bold, which may at first glance make it appear the first of the insertRule lines is the faulty one. This can be disproved by alternately commenting them out, or uncommenting the final .style.color = "black" line, which seems to trigger the change. This is, of course, another bug for another day. I'm not sure whether to leave this report as-is and make another one for the insertRule problem, or turn this bug into a more general bug about scripting rule sets with no declarations.
Same behaviour for the first testcase here (only three items shown). FF shows five, so I suppose this can be confirmed.
Correct. Konqueror only have representation of valid rules. Rules that are ignored are are not supported are ignored at parsing rather than going through a second level of filter. Fixing this will require a new parsing framework that doesn't use flex.
Tested on Konqueror4. The first testcase doesn't show anything. The second testcase display a "TypeError: Value undefined (result of expression document.styleSheets.item) is not object." error.
The issue in comment #1 was fixed by Germain a bit back, one of 4.1.x releases, I think, so that testcase passes now.
Message from the Bugsquad and Konqueror teams: This bug is closed as outdated, as we do not have the manpower to maintain the KDE3 version anymore. If you still can reproduce this issue with Konqueror 4.8.4 or later, please open a new report. Thank you for your understanding.