[whatwg] Comment Syntax and Parsing

Ian Hickson wrote:
> On Tue, 24 Jan 2006, Lachlan Hunt wrote:
>> PA<!- <!-->SS -->                  | "- <!"                   | PASS -->
> 
> Comment should be "- <!--" IMHO. It's still a bogus comment (in HTML5 
> nomenclature), the "--" part is irrelevant.

Ok, so if a comment only starts with '<!' then it ends at the first '>' 
only (ignoring any '--'), but if a comment starts with '<!--' then it 
must end with '-->'.

>> PA<!- -->SS                        | "- "                     | PASS
>> PA<!- -- >SS                       | "- "                     | PASS
> 
> These are bogus comments, so again, they should be "- --" and "- -- " 
> respectively, IMHO.

Ok.

>> PA<!-- > FAIL -- >SS               | " > FAIL "               | PASS
> 
> Disagree. The terminator should be "-->", not "-- S* >". I don't see any 
> good reason to have "-- S* >".

I was working on the assumption that the comment would end at the first 
occurance of '>' while in the comment end state, but that whitespace 
would be ignored while searching for it.  Several browsers already 
handle it like that including Mozilla, Opera and Safari (except in 
Opera, the comment contained " > FAIL -").  Although IE, OmniWeb and 
iCab failed.

-- 
Lachlan Hunt
http://lachy.id.au/

Received on Tuesday, 24 January 2006 15:07:37 UTC