Closed Bug 12496 Opened 21 years ago Closed 21 years ago

[Blocker] [Regression] HTML composition loose the body when sending

Categories

(MailNews Core :: Composition, defect, P3, blocker)

x86
Windows NT
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: bugzilla, Assigned: vidur)

Details

I compose an HTML mail and then send it. The message sent has a blank body.

The problem is due by the fact that the body data receive from Ender through the
call GetContentAsHTML contains bad characters in the <head>...</head> tag that
will make the Unicode to ISO-8859-1 converter to failed.

Dump of the output HTML of the default HTML body (defaultHtmlBody.html):

06B144B0  0D 00 0A 00 3C 00 68 00 74 00 6D 00 6C 00 3E 00 0D 00 0A 00 3C 00 68
00 65  ....<.h.t.m.l.>.....<.h.e
06B144C9  00 61 00 64 00 3E 00 3C 00 21 00 2D 00 2D 00 79 00 70 00 65 00 20 00
68 00  .a.d.>.<.!.-.-.y.p.e. .h.
06B144E2  74 00 6D 00 6C 00 20 00 70 00 75 00 62 00 6C 00 69 00 63 00 20 00 22
00 2D  t.m.l. .p.u.b.l.i.c. .".-
06B144FB  00 2F 00 2F 00 77 00 33 00 63 00 2F 00 2F 00 64 00 74 00 64 00 20 00
68 00  ././.w.3.c././.d.t.d. .h.
06B14514  74 00 6D 00 6C 00 20 00 34 00 2E 00 30 00 20 00 74 00 72 00 61 00 6E
00 73  t.m.l. .4...0. .t.r.a.n.s
06B1452D  00 69 00 74 00 69 00 6F 00 6E 00 61 00 6C 00 2F 00 2F 00 65 00 6E 00
22 00  .i.t.i.o.n.a.l././.e.n.".
06B14546  26 00 67 00 74 00 3B 00 FD FD FD FD DD DD DD DD 2D 00 2D 00 3E 00 0D
00 0A  &.g.t.;.ýýýýÝÝÝÝ-.-.>....
06B1455F  00 3C 00 2F 00 68 00 65 00 61 00 64 00 3E 00 0D 00 0A 00 3C 00 62 00
6F 00  .<./.h.e.a.d.>.....<.b.o.
06B14578  64 00 79 00 20 00 74 00 65 00 78 00 74 00 3D 00 22 00 23 00 30 00 30
00 30  d.y. .t.e.x.t.=.".#.0.0.0
06B14591  00 30 00 30 00 30 00 22 00 20 00 62 00 67 00 63 00 6F 00 6C 00 6F 00
72 00  .0.0.0.". .b.g.c.o.l.o.r.
06B145AA  3D 00 22 00 23 00 66 00 66 00 66 00 66 00 66 00 66 00 22 00 3E 00 0D
00 0A  =.".#.f.f.f.f.f.f.".>....
06B145C3  00 0D 00 0A 00 0D 00 0A 00 54 00 65 00 73 00 74 00 20 00 66 00 6F 00
72 00  .........T.e.s.t. .f.o.r.
06B145DC  20 00 62 00 75 00 67 00 20 00 31 00 32 00 33 00 33 00 34 00 3C 00 62
00 72   .b.u.g. .1.2.3.3.4.<.b.r
06B145F5  00 3E 00 0D 00 0A 00 3C 00 62 00 72 00 3E 00 0D 00 0A 00 3C 00 74 00
61 00  .>.....<.b.r.>.....<.t.a.
06B1460E  62 00 6C 00 65 00 20 00 62 00 6F 00 72 00 64 00 65 00 72 00 20 00 63
00 6F  b.l.e. .b.o.r.d.e.r. .c.o
06B14627  00 6C 00 73 00 3D 00 22 00 31 00 22 00 20 00 77 00 69 00 64 00 74 00
68 00  .l.s.=.".1.". .w.i.d.t.h.
06B14640  3D 00 22 00 31 00 30 00 30 00 25 00 22 00 20 00 62 00 67 00 63 00 6F
00 6C  =.".1.0.0.%.". .b.g.c.o.l
06B14659  00 6F 00 72 00 3D 00 22 00 23 00 66 00 66 00 66 00 66 00 61 00 61 00
22 00  .o.r.=.".#.f.f.f.f.a.a.".
06B14672  3E 00 0D 00 0A 00 3C 00 74 00 62 00 6F 00 64 00 79 00 3E 00 0D 00 0A
00 3C  >.....<.t.b.o.d.y.>.....<
06B1468B  00 74 00 72 00 3E 00 0D 00 0A 00 3C 00 74 00 64 00 3E 00 0D 00 0A 00
3C 00  .t.r.>.....<.t.d.>.....<.
06B146A4  63 00 65 00 6E 00 74 00 65 00 72 00 3E 00 0D 00 0A 00 3C 00 69 00 3E
00 54  c.e.n.t.e.r.>.....<.i.>.T
06B146BD  00 68 00 69 00 73 00 20 00 6D 00 65 00 73 00 73 00 61 00 67 00 65 00
20 00  .h.i.s. .m.e.s.s.a.g.e. .
06B146D6  77 00 61 00 73 00 20 00 73 00 65 00 6E 00 74 00 20 00 62 00 79 00 20
00 3C  w.a.s. .s.e.n.t. .b.y. .<
06B146EF  00 61 00 20 00 68 00 72 00 65 00 66 00 3D 00 22 00 68 00 74 00 74 00
70 00  .a. .h.r.e.f.=.".h.t.t.p.
06B14708  3A 00 2F 00 2F 00 77 00 77 00 77 00 2E 00 6D 00 6F 00 7A 00 69 00 6C
00 6C  :././.w.w.w...m.o.z.i.l.l
06B14721  00 61 00 2E 00 6F 00 72 00 67 00 2F 00 6D 00 61 00 69 00 6C 00 6E 00
65 00  .a...o.r.g./.m.a.i.l.n.e.
06B1473A  77 00 73 00 22 00 3E 00 4D 00 65 00 73 00 73 00 65 00 6E 00 67 00 65
00 72  w.s.".>.M.e.s.s.e.n.g.e.r
06B14753  00 20 00 35 00 2E 00 30 00 3C 00 62 00 72 00 3E 00 3C 00 2F 00 61 00
3E 00  . .5...0.<.b.r.>.<./.a.>.
06B1476C  3C 00 2F 00 69 00 3E 00 3C 00 2F 00 63 00 65 00 6E 00 74 00 65 00 72
00 3E  <./.i.>.<./.c.e.n.t.e.r.>
06B14785  00 0D 00 0A 00 3C 00 2F 00 74 00 64 00 3E 00 3C 00 2F 00 74 00 72 00
3E 00  .....<./.t.d.>.<./.t.r.>.
06B1479E  3C 00 2F 00 74 00 62 00 6F 00 64 00 79 00 3E 00 3C 00 2F 00 74 00 61
00 62  <./.t.b.o.d.y.>.<./.t.a.b
06B147B7  00 6C 00 65 00 3E 00 0D 00 0A 00 0D 00 0A 00 0D 00 0A 00 0D 00 0A 00
3C 00  .l.e.>.................<.
06B147D0  2F 00 62 00 6F 00 64 00 79 00 3E 00 0D 00 0A 00 3C 00 2F 00 68 00 74
00 6D  /.b.o.d.y.>.....<./.h.t.m
06B147E9  00 6C 00 3E 00 0D 00 0A 00 00 00 CD CD CD CD CD CD CD CD CD CD CD CD
CD CD  .l.>.......ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
Summary: [Regression] HTML composition loose the body when sending → [Blocker] [Regression] HTML composition loose the body when sending
cc: jpatel - this may show up in tomorrow's M10 release builds.
Status: NEW → ASSIGNED
Target Milestone: M10
Looking at it.  Here's what I see for the head if I dump the html output from
the editor: somehow the beginning of the "doctype" is getting dropped.

<html>
<head><!--ype html public "-//w3c//dtd html 4.0 transitional//en-->
</head>
At this point you can already see that the html comment is corrupted:
<!--ype html public "-//w3c//dtd html 4.0 transitional//en-->
should be:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
Assignee: akkana → vidur
Status: ASSIGNED → NEW
Turns out it's doing this to all comments, losing the first few characters on
output.  They're fine as they sit in the doc tree inside the editor.

Turns out that layout/base/src/nsCommentNode.cpp recently changed the way it
produces XIF.  Backing up nsCommentNode.cpp to version 3.9 fixes the comment
output problem -- but causes other problems (in display of toolbar icons ?!).
Handing off to Vidur since I'm not sure what his changes were meant to do so I
don't want to risk breaking them while fixing this.
Thanks Akkana for your help.
Maybe I should remove the comment line from the default body file! Any suggestion?
Assignee: vidur → akkana
The fix requires a minor mod to the XIFConverter. Reassigning to Akkana to check
in the fix we discussed.
The comments are now fixed.  Comments no longer include the comment delimiters
in aContent, so the nsXIFConverter no longer has to strip off the delimiters
when creating XIF.

We still have an issue that doctype is generated as a content comment, so the
output has
<!--doctype html public "-//w3c//dtd html 4.0 transitional//en"&gt;-->
instead of
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">

Doctype tags probably shouldn't be going through the XIF content comment
mechanism; we may have to make a new mechanism to handle doctype.
Assignee: akkana → vidur
Vidur, who's doing the parser work to treat doctype comments differently from
standard comments?  That work will have to involve generating XIF as well.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
This does fix the mail send problem (I can send now) so I'm going to close this
so QA can test it, and open a new bug on the more minor issue of getting the
doctype tag format right.
Thanks Akkana & Vidur.
Status: RESOLVED → VERIFIED
OK 1999-10-03-20m10 NT 4.0
OK 1999-10-01-18m110 linux 6.0
OK 1999-10-01-20m10 mac OS 8.5.1
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.