From 5d63a0eb2ae6881c44d41b8a7d06f30d5a4ae6a3 Mon Sep 17 00:00:00 2001 From: snydesc Date: Wed, 25 May 2016 09:52:52 -0400 Subject: [PATCH] Changed to document.documentElement.contains 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. --- src/boxes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/boxes.js b/src/boxes.js index 36dcb1d..1e9d0eb 100644 --- a/src/boxes.js +++ b/src/boxes.js @@ -9,7 +9,7 @@ SVG.BBox = SVG.invent({ 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() -- 2.39.5