We’d been running into this wonderfully informative error message from Firefox recently and finally found some time to track it down. If you’re running into it, check your code to see if you’re trying to grab a reference to the computed style on a null reference. So code like this:
function foo() {
var n = dojo.byId("a-bad-id");
console.log(dojo.getComputedStyle(n));
}
Here’s a simple repro case. If you’re using dojo, you can tickle this a number of ways as a bunch of functions use dojo.getComputedStyle
under the hood, like marginBox, contentBox, style
when used as a getter, and others.
So the moral of the story: make sure you’re passing a valid node reference or a valid node id to functions that work with computedStyle objects.