From: snydesc Date: Wed, 25 May 2016 13:52:52 +0000 (-0400) Subject: Changed to document.documentElement.contains X-Git-Tag: 2.3.2~4^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5d63a0eb2ae6881c44d41b8a7d06f30d5a4ae6a3;p=svg.js.git 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. --- 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()