mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-31 14:35:45 +01:00
Make it impossible for util.computedStyle to return null. Closes issue #180.
This commit is contained in:
@@ -353,13 +353,15 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
|||||||
while (!(node instanceof Ci.nsIDOMElement) && node.parentNode)
|
while (!(node instanceof Ci.nsIDOMElement) && node.parentNode)
|
||||||
node = node.parentNode;
|
node = node.parentNode;
|
||||||
try {
|
try {
|
||||||
return node.ownerDocument.defaultView.getComputedStyle(node, null);
|
var res = node.ownerDocument.defaultView.getComputedStyle(node, null);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {}
|
||||||
util.reportError(e);
|
if (res == null) {
|
||||||
util.dump(String(node));
|
util.dumpStack("Computed style is null: " + node);
|
||||||
|
Cu.reportError(Error("Computed style is null: " + node));
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
return res;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user