Backed out changeset d5a514b9a0db (bug 586587) for mochitest failures.
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 24 Apr 2014 14:48:14 -0400
changeset 180439 45f4f9b91b970ef9f67f5d3418e49749b41daafb
parent 180438 ec9e918e47dd4c9af4cde8d9804267ead85939b3
child 180440 5e6769176ce1af8da2951b36dba0b86590720c1c
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
bugs586587
milestone31.0a1
backs outd5a514b9a0db31234c541fb0bdf65d72a2afee9e
Backed out changeset d5a514b9a0db (bug 586587) for mochitest failures.
dom/events/DataTransfer.cpp
widget/windows/nsClipboard.cpp
widget/windows/nsDragService.cpp
widget/xpwidgets/nsPrimitiveHelpers.cpp
--- a/dom/events/DataTransfer.cpp
+++ b/dom/events/DataTransfer.cpp
@@ -1272,23 +1272,16 @@ DataTransfer::FillInExternalData(Transfe
 
     nsCOMPtr<nsISupportsString> supportsstr = do_QueryInterface(data);
     if (supportsstr) {
       nsAutoString str;
       supportsstr->GetData(str);
       variant->SetAsAString(str);
     }
     else {
-      nsCOMPtr<nsISupportsCString> supportscstr = do_QueryInterface(data);
-      if (supportscstr) {
-        nsAutoCString str;
-        supportscstr->GetData(str);
-        variant->SetAsACString(str);
-      } else {
-        variant->SetAsISupports(data);
-      }
+      variant->SetAsISupports(data);
     }
 
     aItem.mData = variant;
   }
 
 } // namespace dom
 } // namespace mozilla
--- a/widget/windows/nsClipboard.cpp
+++ b/widget/windows/nsClipboard.cpp
@@ -98,18 +98,17 @@ UINT nsClipboard::GetFormat(const char* 
     format = CF_UNICODETEXT;
   else if (strcmp(aMimeStr, kJPEGImageMime) == 0 ||
            strcmp(aMimeStr, kJPGImageMime) == 0 ||
            strcmp(aMimeStr, kPNGImageMime) == 0)
     format = CF_DIBV5;
   else if (strcmp(aMimeStr, kFileMime) == 0 ||
            strcmp(aMimeStr, kFilePromiseMime) == 0)
     format = CF_HDROP;
-  else if (strcmp(aMimeStr, kNativeHTMLMime) == 0 ||
-           strcmp(aMimeStr, kHTMLMime) == 0)
+  else if (strcmp(aMimeStr, kNativeHTMLMime) == 0)
     format = CF_HTML;
   else
     format = ::RegisterClipboardFormatW(NS_ConvertASCIItoUTF16(aMimeStr).get());
 
   return format;
 }
 
 //-------------------------------------------------------------------------
@@ -637,18 +636,17 @@ nsresult nsClipboard::GetDataFromDataObj
           if ( strcmp(flavorStr, kFileMime) == 0 ) {
             // we have a file path in |data|. Create an nsLocalFile object.
             nsDependentString filepath(reinterpret_cast<char16_t*>(data));
             nsCOMPtr<nsIFile> file;
             if ( NS_SUCCEEDED(NS_NewLocalFile(filepath, false, getter_AddRefs(file))) )
               genericDataWrapper = do_QueryInterface(file);
             nsMemory::Free(data);
           }
-        else if ( strcmp(flavorStr, kNativeHTMLMime) == 0 ||
-                  strcmp(flavorStr, kHTMLMime) == 0) {
+        else if ( strcmp(flavorStr, kNativeHTMLMime) == 0) {
           // the editor folks want CF_HTML exactly as it's on the clipboard, no conversions,
           // no fancy stuff. Pull it off the clipboard, stuff it into a wrapper and hand
           // it back to them.
           if ( FindPlatformHTML(aDataObject, anIndex, &data, &dataLen) )
             nsPrimitiveHelpers::CreatePrimitiveForData ( flavorStr, data, dataLen, getter_AddRefs(genericDataWrapper) );
           else
           {
             nsMemory::Free(data);
--- a/widget/windows/nsDragService.cpp
+++ b/widget/windows/nsDragService.cpp
@@ -512,48 +512,40 @@ nsDragService::IsDataFlavorSupported(con
   else {
     // Ok, so we have a single object. Check to see if has the correct
     // data type. Since this can come from an outside app, we also
     // need to see if we need to perform text->unicode conversion if
     // the client asked for unicode and it wasn't available.
     format = nsClipboard::GetFormat(aDataFlavor);
     SET_FORMATETC(fe, format, 0, DVASPECT_CONTENT, -1,
                   TYMED_HGLOBAL | TYMED_FILE | TYMED_GDI);
-    if (SUCCEEDED(mDataObject->QueryGetData(&fe)))
+    if (mDataObject->QueryGetData(&fe) == S_OK)
       *_retval = true;                 // found it!
     else {
       // We haven't found the exact flavor the client asked for, but
       // maybe we can still find it from something else that's on the
       // clipboard
       if (strcmp(aDataFlavor, kUnicodeMime) == 0) {
         // client asked for unicode and it wasn't present, check if we
         // have CF_TEXT.  We'll handle the actual data substitution in
         // the data object.
         format = nsClipboard::GetFormat(kTextMime);
         SET_FORMATETC(fe, format, 0, DVASPECT_CONTENT, -1,
                       TYMED_HGLOBAL | TYMED_FILE | TYMED_GDI);
-        if (SUCCEEDED(mDataObject->QueryGetData(&fe)))
+        if (mDataObject->QueryGetData(&fe) == S_OK)
           *_retval = true;                 // found it!
       }
       else if (strcmp(aDataFlavor, kURLMime) == 0) {
         // client asked for a url and it wasn't present, but if we
         // have a file, then we have a URL to give them (the path, or
         // the internal URL if an InternetShortcut).
         format = nsClipboard::GetFormat(kFileMime);
         SET_FORMATETC(fe, format, 0, DVASPECT_CONTENT, -1,
                       TYMED_HGLOBAL | TYMED_FILE | TYMED_GDI);
-        if (SUCCEEDED(mDataObject->QueryGetData(&fe)))
-          *_retval = true;                 // found it!
-      }
-      else if (!strcmp(aDataFlavor, kHTMLMime)) {
-        // if the client wants html, maybe it's in "HTML Format"
-        format = nsClipboard::GetFormat(kHTMLMime);
-        SET_FORMATETC(fe, format, 0, DVASPECT_CONTENT, -1,
-                      TYMED_HGLOBAL);
-        if (SUCCEEDED(mDataObject->QueryGetData(&fe)))
+        if (mDataObject->QueryGetData(&fe) == S_OK)
           *_retval = true;                 // found it!
       }
     } // else try again
   }
 
   return NS_OK;
 }
 
--- a/widget/xpwidgets/nsPrimitiveHelpers.cpp
+++ b/widget/xpwidgets/nsPrimitiveHelpers.cpp
@@ -48,19 +48,17 @@
 //
 void
 nsPrimitiveHelpers :: CreatePrimitiveForData ( const char* aFlavor, const void* aDataBuff,
                                                  uint32_t aDataLen, nsISupports** aPrimitive )
 {
   if ( !aPrimitive )
     return;
 
-  if ( strcmp(aFlavor,kTextMime) == 0 ||
-       strcmp(aFlavor,kNativeHTMLMime) == 0 ||
-       strcmp(aFlavor,kHTMLMime) == 0) {
+  if ( strcmp(aFlavor,kTextMime) == 0 || strcmp(aFlavor,kNativeHTMLMime) == 0 ) {
     nsCOMPtr<nsISupportsCString> primitive =
         do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID);
     if ( primitive ) {
       const char * start = reinterpret_cast<const char*>(aDataBuff);
       primitive->SetData(Substring(start, start + aDataLen));
       NS_ADDREF(*aPrimitive = primitive);
     }
   }