Bug 1125956 - Hack around the broken assumptions of Thunderbird about the HTML copy encoder by disabling the plaintext encoding detection logic; r=roc

This commit is contained in:
Ehsan Akhgari 2015-02-26 14:34:09 -05:00
parent 70135c9c76
commit df8fd3dc19

View File

@ -1369,6 +1369,10 @@ nsHTMLCopyEncoder::SetSelection(nsISelection* aSelection)
return NS_ERROR_NULL_POINTER;
range->GetCommonAncestorContainer(getter_AddRefs(commonParent));
// Thunderbird's msg compose code abuses the HTML copy encoder and gets
// confused if mIsTextWidget ends up becoming true, so for now we skip
// this logic in Thunderbird.
#ifndef MOZ_THUNDERBIRD
for (nsCOMPtr<nsIContent> selContent(do_QueryInterface(commonParent));
selContent;
selContent = selContent->GetParent())
@ -1395,7 +1399,7 @@ nsHTMLCopyEncoder::SetSelection(nsISelection* aSelection)
}
}
}
// normalize selection if we are not in a widget
if (mIsTextWidget)
{
@ -1403,6 +1407,7 @@ nsHTMLCopyEncoder::SetSelection(nsISelection* aSelection)
mMimeType.AssignLiteral("text/plain");
return NS_OK;
}
#endif
// also consider ourselves in a text widget if we can't find an html document
nsCOMPtr<nsIHTMLDocument> htmlDoc = do_QueryInterface(mDocument);