From 38513f09aed2578843aee1d975416fdddfd5f2e8 Mon Sep 17 00:00:00 2001 From: snydesc Date: Tue, 24 May 2016 17:52:44 -0400 Subject: Changed document.contains to document.body.contains The document object in IE does not have the contains function as a method. This can cause a stack overflow as you can get stuck in an endless try catch loop. document.body.contains will work in IE, Firefox, and Chrome and will resolve this issue. --- src/boxes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/boxes.js b/src/boxes.js index 2b14abd..36dcb1d 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.contains(element.node)) throw new Exception('Element not in the dom') + if(!document.body.contains(element.node)) throw new Exception('Element not in the dom') // find native bbox box = element.node.getBBox() -- cgit v1.2.3