Backout bug 1214377 (rev a0390f2afafd) for build failures, a=rkent THUNDERBIRD_38_VERBRANCH
authorR Kent James <rkent@caspia.com>
Fri, 29 Apr 2016 18:45:43 -0700
branchTHUNDERBIRD_38_VERBRANCH
changeset 261033 ccb59fd997afe3ef8ba6ece586913a39909ab575
parent 261032 78e117e69589ecdc31ae39a8d72c5ac1e2b4afcf
child 261034 e612dadc1a46fea601539593715951fc65ec9db8
push id323
push userkent@caspia.com
push dateSat, 30 Apr 2016 01:46:49 +0000
treeherdermozilla-esr38@ccb59fd997af [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrkent
bugs1214377
milestone38.8.0esrpre
Backout bug 1214377 (rev a0390f2afafd) for build failures, a=rkent
dom/base/nsDocumentEncoder.cpp
--- a/dom/base/nsDocumentEncoder.cpp
+++ b/dom/base/nsDocumentEncoder.cpp
@@ -45,17 +45,16 @@
 #include "nsTArray.h"
 #include "nsIFrame.h"
 #include "nsStringBuffer.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/ShadowRoot.h"
 #include "mozilla/dom/EncodingUtils.h"
 #include "nsContainerFrame.h"
 #include "nsBlockFrame.h"
-#include "nsComputedDOMStyle.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 nsresult NS_NewDomSelection(nsISelection **aDomSelection);
 
 enum nsRangeIterationDirection {
   kDirectionOut = -1,
@@ -1426,51 +1425,42 @@ nsHTMLCopyEncoder::SetSelection(nsISelec
   // here that multi-range selections are table cell selections, in which case
   // the common parent is somewhere in the table and we don't really care where.
   nsresult rv = aSelection->GetRangeAt(0, getter_AddRefs(range));
   NS_ENSURE_SUCCESS(rv, rv);
   if (!range)
     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())
   {
     // checking for selection inside a plaintext form widget
     nsIAtom *atom = selContent->Tag();
     if (atom == nsGkAtoms::input ||
         atom == nsGkAtoms::textarea)
     {
       mIsTextWidget = true;
       break;
     }
-#ifdef MOZ_THUNDERBIRD
-    else if (selContent->IsElement()) {
-      RefPtr<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
   if (mIsTextWidget) 
   {
     mSelection = 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);
   if (!(htmlDoc && mDocument->IsHTML())) {
     mIsTextWidget = true;
     mSelection = aSelection;
     // mMimeType is set to text/plain when encoding starts.
     return NS_OK;