RESOLVED FIXED 9687
WebKit needs to log CSS errors (like FireFox & FireBug do)
https://bugs.webkit.org/show_bug.cgi?id=9687
Summary WebKit needs to log CSS errors (like FireFox & FireBug do)
Eric Seidel (no email)
Reported 2006-07-01 22:40:05 PDT
WebKit needs to be able to log CSS errors (like FireFox & FireBug do) These should be logged any time a declaration is dropped, or a value is ignored.
Attachments
A hack to make this possible (2.06 KB, patch)
2006-12-24 07:40 PST, Eric Seidel (no email)
darin: review-
Eric Seidel (no email)
Comment 1 2006-09-18 20:33:02 PDT
I looked at this very briefly. I would need to talk to hyatt to better understand where we might hook in. There are several places where you might want to throw CSS-related error messages, not all of which should have the same error information. Two examples: 1. parsing a stylesheet for a page. 2. setting a style value via javascript. Firefox handles case 1 quite nicely, but case 2 very poorly (it shows a useless error message). Ideally we would design a system to work across most if not all of the cases where the CSS parser should "throw errors".
Dave Hyatt
Comment 2 2006-09-18 21:48:48 PDT
Errors basically break down into two classes I think... (1) Errors that bison would catch, e.g., bad tokens, bad combinations, etc. (2) Errors that cssparser.cpp would catch, i.e., grammatically well-formed properties that are simply illegal (wrong unit types, wrong # of arguments, etc.) (1) is pretty hard, since we often don't even handle those errors well for real. :) (2) is easier and probably where you'd get more bang for your buck anyway.
mitz
Comment 3 2006-12-16 14:12:07 PST
See also bug 7296.
Eric Seidel (no email)
Comment 4 2006-12-24 07:40:54 PST
Created attachment 12000 [details] A hack to make this possible I don't really expect anyone to take this patch seriously. However it does address the issue at hand (and hopefully could start some small dialog on the subject).
Alexey Proskuryakov
Comment 5 2006-12-24 07:56:08 PST
Do we also want to distinguish errors, warnings and messages, as Firefox does?
Alexey Proskuryakov
Comment 6 2006-12-24 08:22:43 PST
Actually, this patch seems to match bug 10361 better.
Geoffrey Garen
Comment 7 2006-12-24 13:18:10 PST
Doesn't this patch mean "only log JS errors?"
Eric Seidel (no email)
Comment 8 2006-12-24 16:36:40 PST
Personally, I find Firefox's logging system a bit overly geeky. The point of only logging JS errors in my hack-patch, was to maintain the status-quo, as logging more than that might be a "UI decision".
Darin Adler
Comment 9 2006-12-27 22:38:29 PST
Comment on attachment 12000 [details] A hack to make this possible This doesn't seem necessary. I suggest we start logging more on the console, and later add levels and/or types based on our experience using the console.
Timothy Hatcher
Comment 10 2008-07-19 14:26:03 PDT
*** Bug 14358 has been marked as a duplicate of this bug. ***
Blaze Burg
Comment 11 2014-01-12 15:03:05 PST
CSS errors and warnings are logged to console and highlighted in the CSS text editor in the current inspector.
Simon Fraser (smfr)
Comment 12 2014-01-12 22:13:52 PST
But not nearly enough of them. I think we only log syntax errors, right, and then only property names? What about: * invalid values * meaningless combinations of properties (e.g. z-index on non-positioned) * things with perf impact (negative text-indent without overflow:hidden)
Blaze Burg
Comment 13 2014-01-13 09:06:42 PST
Some invalid values are shown as crossed out in the CSS details sidebar, IIRC. The other things sound like audits to me. (I agree we need new audits, but each one in a separate bug.) In any case, I'm not sure that blasting the console with these errors/warnings is the right thing to do. Even with just parse errors today, the console gets filled with junk on popular websites.
Note You need to log in before you can comment on or make changes to this bug.