Closed Bug 170276 Opened 22 years ago Closed 22 years ago

Invalid Comment Tag Renders Enitre Page Invisible

Categories

(Core :: DOM: HTML Parser, defect)

x86
All
defect
Not set
minor

Tracking

()

RESOLVED DUPLICATE of bug 42945

People

(Reporter: mozilla, Assigned: harishd)

References

()

Details

I'm pretty sure this should be invalid, but reporting it just in case.

The URL has a comment tag that is never closed (line 22), but it followed by
other comment tags that are closed. It has no doctype, so it should be quirks mode.

EXAMPLE:

<!-- dum comment
...content...
<!-- another comment -->
...content...

Entire page is blank.

BTW - The page works in NN4 and IE6.
You could look at it two ways I think.

1) The comment in unclosed, and therefor it makes sense that the entire page
after it is blank.

2) Since there are other proper comments after, Mozilla is implicitly allowing
nested comments which, IIRC are not allowed.
You'd need an SGML language lawyer to be certain, but I believe that as the 
SGML comment start/end token is --, the only uncommented text in that example 
is 'another comment'.
I entered a new bug 170283 for the html source viewer.
Source code of the URL after the "comment closed" tag is shown as uncommented
but the browser handled it as commented.
--> Parser
Assignee: attinasi → harishd
Component: Layout → Parser
OS: Windows XP → All
QA Contact: petersen → moied
Heikki, could you please take a look at this? :-)
Assignee: harishd → heikki
Quirks comment parsing is working as expected: it sees, and closes, two
comments. View source shows this ok.

When you look at this in DOM Inspector, you will notice that the document has
HTML, HEAD, 3 META, and BODY tags as well as 5 empty text nodes. There is no
title, no content inside body, according to DOM Inspector.

Back to Harish.
Assignee: heikki → harishd
<title>The Straight Dope: Does smoking have any health <em>benefits?</em</title>

That would be an unclosed <title> tag (which view source also shows correctly,
btw).  

*** This bug has been marked as a duplicate of 42945 ***
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.