Closed Bug 120385 Opened 23 years ago Closed 10 years ago

goof.com - incorrect parsing of HTML comments?

Categories

(Web Compatibility :: Site Reports, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: Daniel.Steinberger, Unassigned)

References

()

Details

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:0.9.7+)
Gecko/20020103
BuildID:    2002010303

on the page http://www.goof.com/pcg/index.html i ran across a comment on the
bottom of the page, stating that my browser could not parse comments correctly.
after reviewing the HTML source i think i *might* be true.

Reproducible: Always
Steps to Reproduce:
1. visit http://www.goof.com/pcg/index.html
2. scroll to the very bottom of the page


Actual Results:  seeing the text:
Did you know that your Browser is buggy: it can't parse comments correctly.

Expected Results:  not seeing text

i checked the HTML source, a sniplet of it is
<!--> Did you know that your Browser is buggy: it can't parse comments
correctly. -->

than i went to w3c - http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.4 -
checking for the definition. it states:
White space is not permitted between the markup declaration open delimiter("<!")
and the comment open delimiter ("--"), but is permitted between the comment
close delimiter ("--") and the markup declaration close delimiter (">"). A
common error is to include a string of hyphens ("---") within a comment. Authors
should avoid putting two or more adjacent hyphens inside comments.

and so there is IMHO a lack of definition here. is this comment misinterpreted
or not? i'm not sure myself! it'll be fine for me, to see this one become
INVALID, _if_ you can explain to me, that it _is_ so, lerying on the HTML
recommendation.
http://bugzilla.mozilla.org/show_bug.cgi?id=102127#c16 gives a good description
of some of the issues involved, but it's too late at night, and my brain hurts,
so I'm going to ask the opinion of someone who can probably work this out better
than me.  

Boris, any idea what's going on here?

We're in strict mode, I think.  The comment at the top has extra hyphens, but
they look carefully counted and cancelling each other out OK.  But from your
comment mentioned above, the one down the bottom of the page should be a
comment, so we shouldn't see the text.

Bug 91045 covers why view-source doesn't parse/highlight properly, but what
about the page itself?
Summary: incorrect parsing of HTML comments → incorrect parsing of HTML comments?
javascript:alert(document.compatMode) shows "BackCompat", which makes sense for
that DTD.  So we are parsing in "quirks" mode, not "standards" mode.  In
"quirks" mode we _do_ parse comments incorrectly, to be compatible with IE5/NS4.

Over to evangelism.  The page is a broken testcase.
Assignee: harishd → doronr
Status: UNCONFIRMED → NEW
Component: Parser → US General
Ever confirmed: true
Product: Browser → Tech Evangelism
QA Contact: moied → zach
Version: other → unspecified
pcg@goof.com for contact info.
My CS class's <a href="http://www.cs.luc.edu/~mhg/comp271/">home page</a> has
comments as follow:
[...]
&lt;!------------ table of contents -------------------&gt;
blah blah blah
&lt;!------------------------------------------&gt;
[...]

"blah blah blah" should show up, but they do not - everything above and below
the comment lines do appear...
er, let's try that again - sorry about the extraneous HTML:

My CS class's home page (http://www.cs.luc.edu/~mhg/comp271/) has comments as
follow:

<!------------ table of contents ------------------->
blah blah blah
<!------------------------------------------>

"blah blah blah" should show up, but they do not - everything above and below
the comment lines do appear...
> "blah blah blah" should show up

No it should not.  Here's the code from that page, with some spaces inserted for
clarity and the commented out stuff between '{' and '}'

<! --{}-- --{}-- --{}-- table of contents --{}-- --{}-- --{}-- --{}-- --{ ->
blah blah blah
<!--} --{}-- --{}-- --{}-- --{}-- --{}-- --{}-- --{}-- --{}-- --{}-- --{}-->

Note that the "blah blah blah" is commented out.
Peter, for a more detailed explanation, see Boris's comments at 

http://bugzilla.mozilla.org/show_bug.cgi?id=102127#c16
and
http://bugzilla.mozilla.org/show_bug.cgi?id=102127#c17

The page is being rendered in strict mode, so strict comment parsing is being used.
now their making fun of us ... check the bottom of the page
maybe somebody should point them to validator ?
Michael, the comment is what this bug is filed on!  Did you even read comment 0?

That said, the page pretty much validates.  They even have a correct doctype. 
It's just that it's a doctype (HTML 4.0 Transitional) that we have chosen to
render in quirks mode.

I'm very tempted to mark this bug as invalid, because I don't think evangelizing
people to switch their page to strict mode is reasonable...
Another, this time high-profile, incorrect page where this shows up is here:
http://www.riksdagen.fi/thwfakta/vpasia/tsframr.htm

This is the document database search page for the Finnish parliament.

The entire search form is accidentally commented out.
i guess they goofed? eh?
Summary: incorrect parsing of HTML comments? → goof.com - incorrect parsing of HTML comments?
tech evang june 2003 reorg
Assignee: doron → english-us
QA Contact: zach → english-us
The 1.5 Browser parses the following code incorrectly:

<html>
<body>
                   <OL TYPE="1">
<!- *********** Insert list items of the form: "<LI><B> +++ Date +++ </B> +++
Item Text +++ </LI><P></P>" **********  ->
                        <LI><B>Dec. 5</B> - Community Christmas Parade, Builders
Club needs adult volunteers to help build the Kiwanis and Sponsored            
                                    Youth Float. Contact Stacy D. if you can
help. </LI><P></P>
                       <!- ******************************* End of list items
******************************* ->
                   </OL>
                  </body>
</html>

It treats the "<LI>" inside the comment as part of the comment, but from the <B>
on, it treats the remainder of the comment as uncommented text. Just do a "View
source" to see how the browser sees this.
*** Bug 315121 has been marked as a duplicate of this bug. ***
The "Did you know that your Browser is buggy" sentence is still there.
Internal Server Error
Assignee: english-us → nobody
Status: NEW → RESOLVED
Closed: 10 years ago
Component: English US → Desktop
Resolution: --- → INVALID
Product: Tech Evangelism → Web Compatibility
You need to log in before you can comment on or make changes to this bug.