[whatwg] About adopting quirks mode parsing

Hi,

From: Ian Hickson <ian@hixie.ch>
>On Mon, 17 Jul 2006, Simon Pieters wrote:
> > As for an algorithm for how to do that, I think that an extra flag would
> > be sufficient. If the parser hits <!-- while in RCDATA or CDATA, the
> > flag is set to true. Then, if the parser hits --> the flag sets to
> > false. Initially the flag is false. While the flag is true the element
> > can't be closed.
>
>It's slightly more complicated than that due to the whole problem with
>things like "<!--->", but yes.

You're right. I forgot about that. I've added more test cases (008-014, and 
003-004 in rcdata)[1].

Opera never treats <!--> as a standalone pseudo-comment.

Firefox treats <!--> as a standalone pseudo-comment for script, but not for 
title and textarea.

IE always treats <!--> as a standalone pseudo-comment.

Safari treats <!--> as a standalone pseudo-comment for style and script, but 
not for noscript, noembed and noframes.

Now, I think that <!--> should always be treated as a standalone 
pseudo-comment if <!--> will be treated as a standalone real comment (in 
PCDATA), otherwise never. (If pseudo-comments really are needed, that is.)

Speaking of PCDATA <!--> comments, it came to me that some pages (such as 
[2] and [3]) might use <!--> in context of IE conditional comments, like so:

   <!--[if !IE]> <--> ... <!--> <![endif]-->

...which doesn't actually rely on <!--> being parsed as one comment.

[1] http://simon.html5.org/test/html/parsing/pseudo-comments/
[2] http://damowmow.com/playground/demos/flash/001.html
[3] http://juicystudio.com/

Regards,
Simon Pieters

Received on Wednesday, 19 July 2006 09:13:22 UTC