IE 11 MutationObserver observe breaks CharacterData data property in XML on hyphens

Fixed Issue #8589859

Details

Author
T L.
Created
Aug 23, 2016
Privacy
This issue is public.
Found in
  • Internet Explorer
Standard affected
DOM Standard

Found in build #
11
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

The data of nodes implementing CharacterData is incorrect when accessed after the document is observed for mutation types childList and subtree together. Other mutation types seem to work fine.

Sample code:

  var observer = new MutationObserver(function() {});
  observer.observe(document, {
    childList: true,
    subtree: true
  });

  var parser = new DOMParser();
  var expectedContent = 'hello-world';
  var xml = parser.parseFromString('<div><![CDATA[' + expectedContent + ']]></div>','text/xml');
  var result = xml.firstChild.firstChild.data;

  // result != expectedContent
  // result == 'hello'
  // <div>hello-world</div> breaks too. Using CDATA as that's my current use case.

Demo: https://talee.github.io/mutationobserver-breaks-characterdata/

Tested on Internet Explorer 11 versions:

Version: 11.0.9600.17843.
Update Versions: 11.0.20 (KB3058515 June 9, 2015).

Version: 11.0.9600.18427.
Update Versions: 11.0.34 (KB3175443 August 9, 2016).

In depth info and code on https://github.com/talee/mutationobserver-breaks-characterdata/.

Attachments

0 attachments

    Comments and activity

    • Markdown CSS on this site is 404 and I see no edit permissions. More readable sample code without Markdown:

      var observer = new MutationObserver(function() {});
      observer.observe(document, {
      childList: true,
      subtree: true
      });

      var parser = new DOMParser();
      var expectedContent = 'hello-world’;
      var xml = parser.parseFromString(‘’ + expectedContent + '
      ‘,’text/xml’);
      var result = xml.firstChild.firstChild.data;

      // result != expectedContent
      // result == ‘hello’
      // hello-world
      breaks too. Using CDATA as that’s my current use case.

      Tested on Internet Explorer 11 versions:

      Version: 11.0.9600.17843.
      Update Versions: 11.0.20 (KB3058515 June 9, 2015).

      Version: 11.0.9600.18427.
      Update Versions: 11.0.34 (KB3175443 August 9, 2016).

      Tests pass on latest Chrome, Firefox, Safari and
      Microsoft Edge 38.14393.0.0
      Microsoft EdgeHTML 14.14393

    • Another significant side effect is that this issue breaks CharacterData data ACROSS iframes even if MutationObservers were not used in the iframe. In other words, using MutationObservers in IE 11 at the top frame will break XML nodes in all child iframes.

    • Microsoft Edge Team

      Changed Status to “Not reproducible”

    • Mona G., what browser version did you attempt to reproduce on and what steps did you take to reproduce? Did you try the demo linked in the description on Internet Explorer 11 and click on the left button to use MutationObservers with XML?

    • Microsoft Edge Team

      Changed Status from “Not reproducible” to “Fixed”

    • Based on recent testing the issue has been fixed and will
      be closed out to reflect this. Should you happen to see the problem as still
      active in Win 10  / MS Edge please feel free to activate the feedback and
      reply.

      Please note that we are not working on IE feature bugs any
      longer at this time unless they are security related.

      All the best,

      The MS Edge Team

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

    Sign in