[whatwg] Serializing HTML fragments (9.4)

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