W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2009

[whatwg] Serializing HTML fragments (9.4)

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 13 Jul 2009 11:08:48 -0700
Message-ID: <4A5B7830.4000608@mit.edu>
Simon Pieters wrote:
>> It's actually rather purposeful, at least in terms of the code.  It'd 
>> be pretty easy to change to returning the textContent instead (so 
>> walking into kids).
> 
> textContent wouldn't emit the tags.

Yes, true.  I thought that's what you were asking for...

> I think the spec currently matches what IE does.

Does IE even support adding a child element to a <script>?

One problem with what the spec currently says, if I read it correctly, 
is that it doesn't round-trip scripts correctly, at least as far as I 
can see.  What Gecko serializes as the innerHTML of the script is 
something that, if you set the script's innerHTML to that value, will 
give a script that is equivalent to the original one if it's executed. 
That doesn't seem to be the case for the spec's current behavior...

-Boris
Received on Monday, 13 July 2009 11:08:48 UTC

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