W3C home > Mailing lists > Public > public-html@w3.org > May 2008

Re: Serializing: Descendants of (R)CDATA elements

From: Ian Hickson <ian@hixie.ch>
Date: Fri, 23 May 2008 00:20:33 +0000 (UTC)
To: Simon Pieters <simonp@opera.com>
Cc: public-html <public-html@w3.org>
Message-ID: <Pine.LNX.4.62.0805230019460.12911@hixie.dreamhostps.com>

On Tue, 18 Mar 2008, Simon Pieters wrote:
> 
> The serializing of HTML fragments algorithm currently looks up the 
> ancestor chain for Text and CDATASection nodes for CDATA elements (or 
> <plaintext>) in order to decide when to escape text.
> 
> Firefox takes a different approach, it seems: when finding an (R)CDATA 
> element (or <plaintext>), emit the data of the child Text and 
> CDATASection nodes (escaped or not as appropriate) instead of recursing 
> the algorithm on its subtree.
> 
> I think Firefox's approach is a bit more performant (it would probably 
> be less checking in the general case), and it roundtrips a bit better; 
> as the spec notes:
> 
>    For instance, if a textarea element to which a Comment node has been
>    appended is serialised and the output is then reparsed, the comment
>    will end up being displayed in the text field.

Including the comment is what IE does.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Friday, 23 May 2008 00:21:11 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:38:55 UTC