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

Won’t fix Issue #11212388

Details

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

Sign in to watch or report this issue.

Steps to reproduce

Environment

IE 11.0.9600.18537 for Windows 7

Problem

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’

Repro

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

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="300" height="300" version="1.1" id="drawing" xmlns:svgjs="http://svgjs.com/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
  console.log(document.documentElement.contains(node));
}
</script>
<rect id="id2" width="100" height="100" x="50" y="50" fill="#ff0066"/>
</svg>

Attachments

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