[whatwg] Serializing HTML fragments (9.4)

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.

-Boris

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