Mozilla doesn't show page content; support <!> and <!foo> comments

VERIFIED FIXED in mozilla1.0

Status

()

Core
HTML: Parser
P2
normal
VERIFIED FIXED
16 years ago
16 years ago

People

(Reporter: Max Alekseyev, Assigned: Heikki Toivonen (remove -bugzilla when emailing directly))

Tracking

({regression})

Trunk
mozilla1.0
regression
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [fixinhand], URL)

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

16 years ago
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (OS/2; U; Warp 4.5; en-US; rv:0.9.9+) Gecko/20020319
BuildID:    2002031916

Latest Mozilla shows empty page instead of actual content.
Release 0.9.9 version worked fine on this page but in the latest night builds
something was broken. ;-(


Reproducible: Always
Steps to Reproduce:
1. Go to given URL
2.
3.
To parser (there are no nodes, so nothing to lay out).  The page has:

<!doctype html public "HTML 4.0">
<!ThIs PaGe Is ToTaLly HaNd MaDe By DaNiEl CaEtAnO uSiNg Os/2 sYsTeM eDiToR>

Removing either line makes things work.

ccing heikki because this is likely related to the recent comment-parsing
changes....  Seeing this on Linux as well.
Assignee: attinasi → harishd
Status: UNCONFIRMED → NEW
Component: Layout → Parser
Ever confirmed: true
OS: OS/2 → All
QA Contact: petersen → moied
Hardware: PC → All
The doctype line kicks us into strict mode, and it could be argued that perhaps
in this case it shouldn't.

Our strict comment parsing follows exactly what HTML 4.01 specifies is a comment:

http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.4

This is an argument that we should NOT fix the strict comment parsing code (but
maybe we should fix "strict detection").

However, one can also argue that because SGML itself allows (although HTML 4.01
prohibits this) a short comment of the form: 

<!>

and because our old code supported that as well as the completely bogus form:

<!This is foobar>

we should be backwards compatible and/or follow SGML in this matter.

Comments?
Status: NEW → ASSIGNED
Keywords: regression
Hi ho.  The relevant SGML production is:

[91] comment declaration = mdo ( comment, ( s | comment )* )?, mdc

where mdo is "<!", mdc is ">", and a comment is two comment delimiters (--) and
the data between them.  The "?" indicates that the preceding expression is
repeatable zero or one times.  So <!-- comment -->, <!-- comment -- --comment
-->, and <!> are all legitimate in SGML.  (It does seem odd that the expression
isn't marked as repeatable one or more times, but go figure.)

My inclination would be to fix the strict comment parsing to handle "<!>" (I
regard the attempt of the HTML spec to disallow legitimate SGML constructs as so
much nonsense) and punt this particular case to evangelism.
There is also the forwards compatibility argument: in XML <!> is a fatal
well-formedness error. This is an argument that we should NOT fix this.
Assignee: harishd → heikki
Status: ASSIGNED → NEW
Status: NEW → ASSIGNED
Priority: -- → P2
Target Milestone: --- → mozilla1.0
Created attachment 75675 [details] [diff] [review]
better fix, the outer if condition was always true
Attachment #75280 - Attachment is obsolete: true
Summary: Mozilla doesn't show page content → Mozilla doesn't show page content; support <!> and <!foo> comments
Whiteboard: [fixinhand]
Bug 110544 was the one that caused this.

Comment 9

16 years ago
Comment on attachment 75675 [details] [diff] [review]
better fix, the outer if condition was always true

r=harishd
Attachment #75675 - Flags: review+
Comment on attachment 75675 [details] [diff] [review]
better fix, the outer if condition was always true

sr=jst
Attachment #75675 - Flags: superreview+

Comment 11

16 years ago
Comment on attachment 75675 [details] [diff] [review]
better fix, the outer if condition was always true

a=asa (on behalf of drivers) for checkin to the 1.0 trunk
Attachment #75675 - Flags: approval+
Checked in.
Status: ASSIGNED → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → FIXED

Comment 13

16 years ago
Verified fix checked in CVS (Rev 3.216)
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.