Closed Bug 273709 Opened 20 years ago Closed 20 years ago

specific HTML-comments are displayed

Categories

(Core :: DOM: HTML Parser, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: kubieziel, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041111 Firefox/1.0 (Debian package 1.0-2)
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041111 Firefox/1.0 (Debian package 1.0-2)

Assume there is a comment like:
<!-->This is a comment-->
in a HTML page. If you display that in FF, it shows the comment.

As far as I understand the HTML-Spec it is a normal comment, so it should not be
displayed.

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Actual Results:  
I see a comment, which shouldn't displayed.

Expected Results:  
Don't see the comment.
<!-->This is NOT a comment-->

<!--THIS is a comment-->
Over to Parser.
Assignee: firefox → parser
Component: General → HTML: Parser
Product: Firefox → Core
QA Contact: firefox.general → mrbkap
Version: unspecified → Trunk
The comment is only displayed when in quirks mode.

Change the DOCTYPE to "HTML 4.0.1 Transitional" so that Mozilla displays the
page in Standards compliance mode, and you wont see it again.

I think I remember such problems in quirks mode are not fixed, some older page
might depend on them. If you want a really predictable behaviour from Mozilla,
use a DOCTYPE that is rendered in standards mode.
It breaks because you cannot have -- in the body of a comment.  That
opens/closes the comment. See
http://www.w3.org/TR/html401/intro/sgmltut.html#idx-HTML
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
(In reply to comment #4)
> It breaks because you cannot have -- in the body of a comment.  That
> opens/closes the comment. See
> http://www.w3.org/TR/html401/intro/sgmltut.html#idx-HTML

There is no extra "--" inside that comment. According to that site "<!-->bla-->"
is a correct comment. However Jean-Marc advise is correct. If the browser is in
standards compliance mode, the comment disappers from the web page.
You need to log in before you can comment on or make changes to this bug.