[Bug 12584] outerHTML should probably merge with adjacent text nodes if applicable. IE seems to do this to some extent, and WebKit just changed to do it: <https://bugs.webkit.org/show_bug.cgi?id=52686> This test shows behavior for outerText and outerHTML: <http://so

https://www.w3.org/Bugs/Public/show_bug.cgi?id=12584

--- Comment #3 from Arkadiusz Michalski (Spirit) <crimsteam@gmail.com> ---
One more thing, IE11 also merge text nodes for Element.insertAdjacentHTML(),
but Chrome and Firefox no.

<script type = "text/javascript">

        var container = document.createElement("div");
        container.appendChild(document.createTextNode("Text node 1"));
        container.appendChild(document.createTextNode("Text node 2"));
        container.appendChild(document.createElement("div"));

        container.childNodes[2].insertAdjacentHTML("beforebegin", " Parsed
text");
        alert(container.childNodes.length);
        alert(container.childNodes[1].data);

</script>

Firefox, Chrome alerts: 4, Text node 2
IE11 alerts: 3, Text node 2 Parsed text

I'm opposite for merging text node in all this cases, they change node tree
without possibility of control this behaviour. If someone want clean up tree
then can use Node.normalize() or other way (how he want). There is no need to
complicate this more.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Friday, 2 October 2015 01:23:57 UTC