document.documentElement.contains is undefined in top-level SVG documents

Won’t fix Issue #11212388


Mar 9, 2017
This issue is public.
Found in
  • Internet Explorer
Found in build #
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce


IE 11.0.9600.18537 for Windows 7


If you open an SVG file that runs javascript that uses document.documentElement.contains(), it turns out this method is undefined and you get the following error:

SCRIPT438: Object doesn’t support property or method ‘contains’


Using text editor, create an SVG file, paste the following content, save it and open it in IE 11.

<svg xmlns="" xmlns:xlink="" width="300" height="300" version="1.1" id="drawing" xmlns:svgjs="">
<script type="text/ecmascript">
window.onload = function(e){ 
  var node = document.getElementById("id2");
  // The following line works in FF and Chrome and Microsoft Edge 38.14393.0.0
  // Gives SCRIPT438: Object doesn't support property or method 'contains' in IE 11.0.9600.18537 for Windows 7
<rect id="id2" width="100" height="100" x="50" y="50" fill="#ff0066"/>


0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “James M.”

      Changed Status to “Won’t fix”

    • Hello,

      Thank you for providing your feedback on IE11. We are not accepting feedback on Internet Explorer through this portal any longer (unless security related). However, we are pleased to report this feature is fixed in MS Edge.

      Best Wishes,
      The MS Edge Team

    You need to sign in to your Microsoft account to add a comment.

    Sign in