On Thu, 09 Jul 2009 19:38:58 +0200, Boris Zbarsky <bzbar...@mit.edu> wrote:

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

textContent wouldn't emit the tags.

I think the spec currently matches what IE does.


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.

--
Simon Pieters
Opera Software

Reply via email to