Bug 1125963 - Part 1: Fix serialization of the pre-wrap elements that Thunderbird relies on; r=bzbarsky

This ensures that the plaintext serializer doesn't use the preformatted
text code path if we have encountered a pre-wrap element that
Thunderbird uses (which means setting white-space: pre-wrap and width:
NNch on the body element.)

It also ensures that we use 0 as the wrap column number passed down to
the plaintext serializer, instead of -1, which this code seems to be
unable to handle properly.
This commit is contained in:
Ehsan Akhgari
2015-02-26 15:26:12 -05:00
parent 5cc5631204
commit e017c67b6c
5 changed files with 41 additions and 5 deletions

View File

@@ -1713,7 +1713,7 @@ nsTextEditorState::InitializeRootNode()
nsAutoString classValue;
classValue.AppendLiteral("anonymous-div");
int32_t wrapCols = GetWrapCols();
if (wrapCols >= 0) {
if (wrapCols > 0) {
classValue.AppendLiteral(" wrap");
}
if (!IsSingleLineTextControl()) {