Comment 17 for bug 642529

Revision history for this message
In , Laurent-xulfr (laurent-xulfr) wrote :

I investigated and here my thought.

First, the HTML serializer is ok for me. Existing unit tests show that serialization is ok with the flag nsIDocumentEncoder::OutputFormatted. Changes I made are improvements on the indentation, this is why we have additionnal spaces in the html in the attachement 447194.

Second, it seems that the nsMsgCompose::sendMsg() method (if this is really this method which is called when we send a message) doesn't call the html serializer, but the plain text serializer, since it calls the document encoder with the mime type "text/plain" (well, in fact it calls nsEditor::OutputToString which then calls the encoder). So my work on the HTML serializer is not (at least directly) responsible of the bug.

So I think that the bug is inside the plain text serializer. Then, why this bug appears after my work on the HTML serializer? I guess that the HTML serializer is called some times (when and where, I don't know, maybe by the editor), and the result is probably re-parsed, so we certainly have a new DOM with these additionnals white spaces (for indendation). But the plain text serializer probably doesn't support very well these additionnal spaces and add some spaces in the result when nsMsgCompose::sendMsg() call it.

I'm not familiar at all with the mail code, so perhaps I'm saying wrong things. Don't hesitate to correct my hypothesis if they are wrong.

I could see inside the plain text serializer if there is really a bug, but not before the next week.