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=refs%2Fpull%2F490%2Fhead;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()