Closed Bug 132238 Opened 22 years ago Closed 22 years ago

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

Categories

(Core :: DOM: HTML Parser, defect, P2)

defect

Tracking

()

VERIFIED FIXED
mozilla1.0

People

(Reporter: relf, Assigned: hjtoi-bugzilla)

References

()

Details

(Keywords: regression, Whiteboard: [fixinhand])

Attachments

(2 files, 1 obsolete file)

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
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 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 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
Closed: 22 years ago
Resolution: --- → FIXED
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.

Attachment

General

Created:
Updated:
Size: