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

[whatwg] Serializing HTML fragments (9.4)

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Thu, 09 Jul 2009 10:38:58 -0700
Message-ID: <4A562B32.2000809@mit.edu>
Kartikaya Gupta wrote:
> Opera and Chrome will alert "<c1>some&gt;stuff</c1>more<stuff" (escaping the angle bracket inside the child element) and Firefox just outputs "more<stuff" (presumably a bug).

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).

See https://bugzilla.mozilla.org/show_bug.cgi?id=125746 for the history 
here (the code has just been carried along since).

> I tried a couple of the other special elements (script and xmp) and they worked the same way. I think for compatibility the spec should say "If the parent of the current node is a" instead of "If one of the ancestors of current node is a" for the Text/CDATASection handling.

No opinion on this, honestly.

Received on Thursday, 9 July 2009 10:38:58 UTC

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