Closed Bug 174862 Opened 24 years ago Closed 24 years ago

Mozilla chokes on consecutive dashes (hyphens) within an HTML comment.

Categories

(Core :: DOM: HTML Parser, defect)

PowerPC
Mac System 9.x
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: Stan.Warford, Assigned: harishd)

References

Details

User-Agent: Mozilla/5.0 (Macintosh; U; PPC; en-US; rv:1.1) Gecko/20020826 Build Identifier: Mozilla/5.0 (Macintosh; U; PPC; en-US; rv:1.1) Gecko/20020826 Here is a test file that reders correctly in IE but not in Mozilla: <!DOCTYPE HTML PUBLIC "-//W3C/DTD HNTML 4.01//EN"> <html> Should be visible A. <!-- Should be invisible B. -- Should be invisible C. --> Should be visible D. Reproducible: Always Steps to Reproduce: 1. Open the above file. 2. 3. Actual Results: The items that should be invisible, because they are enclosed in an HTML comment are visible. Expected Results: It should have made them invisible. IE parses this correctly. It looks like the HTML parser is checking for -- instead of for --> to terminate an HTML comment.
Actually, Mozilla is parsing using the correct HTML rules for comments; it is your interpretation that is incorrect. "<!" begins a markup declaration (in this case, a comment declaration) and "--" opens the comment itself. A second "- -" closes the comment; it may be followed by whitespace and/or another comment before the comment declaration is closed by ">". IOW, <!-- this is a comment -- this doesn't belong here, because it's not a comment -- this is a comment again --> (And you've misspelled "HTML" in your DOCTYPE, although that happens not to change Mozilla's behavior in this case.) INVALID.
Status: UNCONFIRMED → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
*** Bug 262754 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.