Backed out changeset b3d28572da60 (bug 1214377) for breaking thunderbird builds a=backout

--HG--
extra : commitid : 1Yy1GwPKEJh
This commit is contained in:
Wes Kocher 2015-11-06 11:30:00 -08:00
Родитель 672fda2c82
Коммит c37efdf9c9
1 изменённых файлов: 5 добавлений и 15 удалений

Просмотреть файл

@ -51,7 +51,6 @@
#include "mozilla/dom/EncodingUtils.h" #include "mozilla/dom/EncodingUtils.h"
#include "nsContainerFrame.h" #include "nsContainerFrame.h"
#include "nsBlockFrame.h" #include "nsBlockFrame.h"
#include "nsComputedDOMStyle.h"
using namespace mozilla; using namespace mozilla;
using namespace mozilla::dom; using namespace mozilla::dom;
@ -1429,6 +1428,10 @@ nsHTMLCopyEncoder::SetSelection(nsISelection* aSelection)
return NS_ERROR_NULL_POINTER; return NS_ERROR_NULL_POINTER;
range->GetCommonAncestorContainer(getter_AddRefs(commonParent)); 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)); for (nsCOMPtr<nsIContent> selContent(do_QueryInterface(commonParent));
selContent; selContent;
selContent = selContent->GetParent()) selContent = selContent->GetParent())
@ -1439,20 +1442,6 @@ nsHTMLCopyEncoder::SetSelection(nsISelection* aSelection)
mIsTextWidget = true; mIsTextWidget = true;
break; break;
} }
#ifdef MOZ_THUNDERBIRD
else if (selContent->IsElement()) {
nsRefPtr<nsStyleContext> styleContext =
nsComputedDOMStyle::GetStyleContextForElementNoFlush(
selContent->AsElement(), nullptr, nullptr);
if (styleContext) {
const nsStyleText* textStyle = styleContext->StyleText();
if (textStyle->mWhiteSpace == NS_STYLE_WHITESPACE_PRE_WRAP) {
mIsTextWidget = true;
}
}
}
break;
#endif
} }
// normalize selection if we are not in a widget // normalize selection if we are not in a widget
@ -1462,6 +1451,7 @@ nsHTMLCopyEncoder::SetSelection(nsISelection* aSelection)
mMimeType.AssignLiteral("text/plain"); mMimeType.AssignLiteral("text/plain");
return NS_OK; return NS_OK;
} }
#endif
// also consider ourselves in a text widget if we can't find an html document // also consider ourselves in a text widget if we can't find an html document
nsCOMPtr<nsIHTMLDocument> htmlDoc = do_QueryInterface(mDocument); nsCOMPtr<nsIHTMLDocument> htmlDoc = do_QueryInterface(mDocument);