W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2011

[whatwg] When a script element's child nodes are changed

From: David Flanagan <dflanagan@mozilla.com>
Date: Fri, 28 Oct 2011 12:07:32 -0700
Message-ID: <4EAAFD74.6000109@mozilla.com>
On 10/28/11 12:03 PM, Bjoern Hoehrmann wrote:
> * David Flanagan wrote:
>> All browsers do that correctly.  The case I'm interested in is this one:
>>
>>      var s1 = document.createElement("script");
>>      var t1 = document.createTextNode("");
>>      s1.appendChild(t1);
>>      document.head.appendChild(s1);
>>      t1.appendData("alert('changed text node data');");
>>
>> Firefox runs this script and Chrome, Safari and Opera do not. (I don't
>> have a windows installation, so I haven't tested IE)
> In "IE9 standards" mode IE9 displays the alert.
>
Thanks, Bjoern. That makes it a lot harder for me to argue that the spec 
should change to match Chrome, Safari and Opera... But can we at least 
change  "when child nodes change" to something like "when the text IDL 
attribute changes from the empty string to a non-empty string"?

     David

>> We're not done yet, though.  If I comment out the appendData() call in
>> the code above and replace it with this line:
>>
>>      s1.appendChild(document.createTextNode("alert('then added a new
>> text node');"));
> As above, IE9 displays the alert.
Received on Friday, 28 October 2011 12:07:32 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:37 UTC