Closed Bug 103529 Opened 23 years ago Closed 22 years ago

mnemo.nu - Bad Table layout because of illegal comment <!---------->

Categories

(Tech Evangelism Graveyard :: English Other, defect, P3)

defect

Tracking

(Not tracked)

VERIFIED INVALID

People

(Reporter: wolruf, Assigned: tristan)

References

()

Details

(Whiteboard: [SYNTAX-HTML][havefix])

Attachments

(2 files)

build: 2001100610 on Win2k.

Steps to reproduce:
1. load URL http://mnemo.nu/atheos/about.html ,
2. See the incorrectly centered table.

Expected behaviour: should draw the tables correctly, as IE6 does. If we delete
the doctype, the page loads as expected.
with the dtd declaration only 2 tables can be seen (visually and in the DOM),
without the dtd 5 tables can be seen. Probably need more investigation.
seems like something is messed up with the comment --> matching. I'm not sure
what is causing this behavior. Is it because --> must come after a space? That
doesn't explain why it matches the third occuring -->

This looks more like a parser bug
after removing the comments it seems to work. However adding spaces to after
<!-- and before --> helps a bit but does not fix the problem.
Assignee: attinasi → harishd
Component: Layout → Parser
QA Contact: petersen → moied
*sigh*  Time for a quick SGML refresher.  <! opens a markup declaration 
section, the contents of which are not made visible by the user agent.  Within 
such a section, -- serves as the comment delimiter.  The *only markup* that can 
terminate a comment is --; > is parsed as character data within a comment.  So, 
long strings of dashes inside markup declaration sections are actually 
switching comments on, off, on, off, etc; in this case, at the end of the first 
line of their second markup declaration, there's a comment open, followed 
immediately by ->.  Because it's in a comment, that > doesn't end the markup 
declaration section, and so the parser goes on to consume the table.  If you 
want to use strict DTD, you'll have to use proper SGML comments-if you really 
need the visual effect of <!---------- my comment here! ------>, use <!--
========== my comment here! ========--> instead, it's safer.  Over to 
Evangelism.
Assignee: harishd → nitot
Component: Parser → Europe: West
Product: Browser → Tech Evangelism
QA Contact: moied → caillon
Version: other → unspecified
OS: Windows 2000 → All
Hardware: PC → All
Summary: Bad Table layout with known doctype → mnemo.nu - Bad Table layout because of illegal comment <!---------->
Whiteboard: [SYNTAX-HTML]
Confirming On N62/Win2K. Accepting bug. Setting P3
Status: NEW → ASSIGNED
Setting P3 as said before.
Priority: -- → P3
How should Mozilla handle nested comments ?
I personally think that the first instance of -->
should terminate the comment, and the text after that should be visible.
(Hoess, what do you think ?)
But I can't find out what W3 recommends; all I found was
  Authors should avoid putting two or more adjacent hyphens inside comments.
  http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.4
.

I've attached an example that Mozilla handles inconsistently.
When I view nested_comment_test.html with Mozilla (build id: 2001112009;
Windows), it does not render the ``Everything'' text.
If Mozilla were consistent, then when I hit ``View | Page Source'', the missing
stuff would be colored green like all the other stuff inside the comment. But I
see that the ``Everything'' text is colored black like normal paragraph text.

Original poster said:
``If we delete the doctype, the page loads as expected.''
When I delete the doctype on nested_comment_test.html, the ``Everything'' text
suddenly become visible. Is that doctype triggering some weird quirks mode ?
Site has been contacted.
There are parts of a table commented for later use in this html. but the "--"
in the end of line 246 "<!--BUSCA-SARAIVA-468x60--" (start of the comment
block) makes the table messy.
In the end of that comment theres a line "<!--/BUSCA-SARAIVA-468x60-->" wich
ends the comment (the 1st time a --> appears) but in here, the "--" on the
start of the line (in the "<!--") don't cause any trouble at all.
If i change only line 246 to "<!--BUSCA-SARAIVA-468x60-" (no double "-" in the
end of line) then everything goes fine.
Whiteboard: [SYNTAX-HTML] → [SYNTAX-HTML][havefix]
URL no longer exists.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
v
Status: RESOLVED → VERIFIED
New Component
Component: Europe: West → English Other
Product: Tech Evangelism → Tech Evangelism Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: