diff options
author | snydesc <scottsnyder@snysco.com> | 2016-05-24 17:52:44 -0400 |
---|---|---|
committer | snydesc <scottsnyder@snysco.com> | 2016-05-24 17:52:44 -0400 |
commit | 38513f09aed2578843aee1d975416fdddfd5f2e8 (patch) | |
tree | 17d6c56f73b45ffeacb55c89ee4ad0dd6622a427 /src | |
parent | 430f6c2931b75a5ebb2ea651b26730805cd3a7e4 (diff) | |
download | svg.js-38513f09aed2578843aee1d975416fdddfd5f2e8.tar.gz svg.js-38513f09aed2578843aee1d975416fdddfd5f2e8.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/boxes.js | 2 |
1 files changed, 1 insertions, 1 deletions
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() |