Invalid argument error when changing nodeValue of a text node removed by setting innerHTML on an ancestor

Issue #697629


Aug 12, 2014
This issue is public.
Reported by 0 people

Sign in to watch or report this issue.

Steps to reproduce


Repro Steps: contains the following minimal test case, reproducible in IE 11.0.9600.17207 (Update Versions 11.0.10, running on Windows 7):

<!-- A div is created containing a single text node -->
<div id="div">Test</div>

// We obtain a reference to the text node
var text = div.firstChild;

// We remove the text node from the div by setting its innerHTML. Removing this line, or replacing with div.removeChild(text) prevents the error
div.innerHTML = 'Other text’;

// We attempt to set the text node’s nodeValue
text.nodeValue = 'New value’; // --> “SCRIPT87: Invalid argument.” error thrown and shown in the developer console.

Expected Results:

Expected the text node to behave the same way after setting its parent’s innerHTML as it would when removing it using the parent’s removeChild method. In both cases, setting nodeValue should be possible and not throw an error. Currently, the text node is only usable if removeChild has been used to remove it, not if innerHTML has been used instead.

Actual Results:

Dev Channel specific:



0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Tony S.”

      Changed Assigned To from “Tony S.” to “Eugene V.”

      Changed Assigned To from “Eugene V.” to “Sanket J.”

      Changed Status to “Confirmed”

      Changed Assigned To from “Sanket J.” to “IE F.”

      Changed Status from “Confirmed” to “Won’t fix”

      Changed Status from “Won’t fix”

      Changed Steps to Reproduce

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

    Sign in