document.contains will not work in IE.
document.body.contains will work in IE, Chrome, and Firefox however will not work on SVG only documents.
document.documentElement.contains appears to work for all variations.
try {
// the element is NOT in the dom, throw error
- if(!document.body.contains(element.node)) throw new Exception('Element not in the dom')
+ if(!document.documentElement.contains(element.node)) throw new Exception('Element not in the dom')
// find native bbox
box = element.node.getBBox()