Comments dropped from html output

VERIFIED FIXED in M12

Status

()

defect
P3
normal
VERIFIED FIXED
20 years ago
20 years ago

People

(Reporter: akkzilla, Assigned: harishd)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Reporter

Description

20 years ago
TestOutput -i text/html -o text/html OutTestData/simple.html

Two problems:
1. The <html> tag gets translated as an empty tag, <>.

2. The start comment is there, but the rest of the comment, including the end
tag, is dropped.  I'm guessing this may have something to do with the doctype
change.
Reporter

Updated

20 years ago
Status: NEW → ASSIGNED
Target Milestone: M12
Reporter

Updated

20 years ago
Assignee: akkana → harishd
Status: ASSIGNED → NEW
Reporter

Comment 1

20 years ago
#1 is because GetText() on a eHTMLTag_html node returns an empty string.  Harish
said I could reassign that to him.

#2 is because comment handling has changed: the following change fixes the
problem and puts comments into the output.  Harish, could you review this?

Index: nsHTMLContentSinkStream.cpp
===================================================================
RCS file: /cvsroot/mozilla/htmlparser/src/nsHTMLContentSinkStream.cpp,v
retrieving revision 3.63
diff -r3.63 nsHTMLContentSinkStream.cpp
1168c1168
<   Write("<!--");
---
>   Write(aNode.GetText());
Assignee

Comment 2

20 years ago
For #1
*********************************
in CNavDTD::WillBuildModel()
*********************************

Index: CNavDTD.cpp
===================================================================
RCS file: /cvsroot/mozilla/htmlparser/src/CNavDTD.cpp,v
retrieving revision 3.223
diff -r3.223 CNavDTD.cpp
409c409,410
<     CStartToken theToken(eHTMLTag_html);
---
>     nsAutoString theTagName("html");
>     CStartToken theToken(theTagName,eHTMLTag_html);
Reporter

Comment 3

20 years ago
Note re #2: this is when parsing html.  But with the proposed change, when we're
parsing from XIF, the body and end comment tag come through, but in place of the
start comment I see the string "comment".  That's because when parsing XIF,
GetText on a comment node gets the string "comment".

I need to find some way either of getting all three parts of the comment, or of
getting the whole comment including start and end tags, reliably so that it
works regardless of whether we were parsing html or xif.  Harish, any
suggestions?
Assignee

Updated

20 years ago
Status: NEW → RESOLVED
Last Resolved: 20 years ago
Resolution: --- → FIXED
Assignee

Comment 4

20 years ago
Akkana, the code is in to handle #1 and #2.

FIXED

Updated

20 years ago
Status: RESOLVED → VERIFIED

Comment 5

20 years ago
verified in 11/29 build.

Comment 6

20 years ago
Bulk move of all "Output" component bugs to new "DOM to Test Conversion" 
component.  Output will be deleted as a component.

Updated

20 years ago
Component: Output → DOM to Text Conversion
You need to log in before you can comment on or make changes to this bug.