Open Bug 1375126 Opened 4 years ago Updated 4 years ago
Runtime warnings about undefined CSS variables should turn the tree orange
bug 1347182 landed and broke a bunch of styling for stuff, but crucially tests were green. Part of the reason things broke was that it was using CSS variables that aren't actually defined, which cause heaps of warnings in the browser console. Missing CSS variables for style rules that do get applied are, AFAICT, always a mistake / problem, so we should try to catch them in automation. However, right now, no test framework cares about this. We try to deal with very obvious CSS mistakes using https://dxr.mozilla.org/mozilla-central/source/browser/base/content/test/static/browser_parsable_css.js but that doesn't actually detect these cases. It would be nice if we either had a specific test that checked for this, and/or if the mochitest framework complained about this type of console message if found after a test (much like it checks for leaks and contamination of the window global after tests). We would probably need initial whitelists as we do for some of the other static-y tests.
I think this just needs mochitest's framework files to add a console listener that yelps about CSS variable issues, and adds test failures for them.
Component: CSS Parsing and Computation → Mochitest
Product: Core → Testing
You need to log in before you can comment on or make changes to this bug.