1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-09 14:54:11 +01:00

Make it impossible for util.computedStyle to return null. Closes issue #180.

This commit is contained in:
Kris Maglione
2010-12-27 01:51:33 -05:00
parent f2bcfa99ea
commit 299ff0ecb3

View File

@@ -353,13 +353,15 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
while (!(node instanceof Ci.nsIDOMElement) && node.parentNode)
node = node.parentNode;
try {
return node.ownerDocument.defaultView.getComputedStyle(node, null);
var res = node.ownerDocument.defaultView.getComputedStyle(node, null);
}
catch (e) {
util.reportError(e);
util.dump(String(node));
catch (e) {}
if (res == null) {
util.dumpStack("Computed style is null: " + node);
Cu.reportError(Error("Computed style is null: " + node));
return {};
}
return res;
},
/**