[prev in list] [next in list] [prev in thread] [next in thread] 

List:       whatwg
Subject:    Re: [whatwg] Inserting a DocumentFragment of multiple text nodes
From:       Bjoern Hoehrmann <derhoermi () gmx ! net>
Date:       2011-10-28 21:46:22
Message-ID: sf8ma71ibonk50bppnu6rav53qio64mm6s () hive ! bjoern ! hoehrmann ! de
[Download RAW message or body]

* David Flanagan wrote:
>What is the correct behavior for the following code?
>
><script>
>window.onload = test;
>
>function test() {
>     var s = document.createElement("script");
>     document.head.appendChild(s);
>
>     var f = document.createDocumentFragment();
>     
>f.appendChild(document.createTextNode("alert(document.scripts[1].text);"));
>     f.appendChild(document.createTextNode("alert(2);"));
>     f.appendChild(document.createTextNode("alert(3);"));
>
>     s.appendChild(f);
>
>     alert(s.text);
>}
></script>
>
>In Firefox, the code in all three text nodes runs, so there are 4 alerts 
>in total, and the first and the fourth display the same text: the 
>concatenation of the three text nodes.

IE9 Standards mode is the same.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic