Bug 1517627 - Port bug 1517241: Rename nsIDocument to mozilla::dom::Document. rs=bustage-fix
authorJorg K <jorgk@jorgk.com>
Fri, 04 Jan 2019 01:02:42 +0100
changeset 34111 fb2b3b15feed42f3603e7926e926919a968a8499
parent 34110 5eb6060762704a4f9d30485ff0b7b7d90fcec9ee
child 34112 1ae2793b99f0188bc7ac7645e14c6a9c4144538b
push id389
push userclokep@gmail.com
push dateMon, 18 Mar 2019 19:01:53 +0000
reviewersbustage-fix
bugs1517627, 1517241
Bug 1517627 - Port bug 1517241: Rename nsIDocument to mozilla::dom::Document. rs=bustage-fix
mailnews/base/src/MailNewsDLF.cpp
mailnews/base/src/nsMsgMailSession.cpp
mailnews/base/src/nsMsgStatusFeedback.cpp
mailnews/compose/src/nsMsgCompUtils.cpp
mailnews/compose/src/nsMsgCompUtils.h
mailnews/compose/src/nsMsgCompose.cpp
mailnews/compose/src/nsMsgComposeContentHandler.cpp
mailnews/compose/src/nsMsgComposeService.cpp
mailnews/compose/src/nsMsgSend.cpp
mailnews/import/winlivemail/nsWMSettings.cpp
mailnews/import/winlivemail/nsWMUtils.cpp
mailnews/import/winlivemail/nsWMUtils.h
mailnews/mime/src/mimeTextHTMLParsed.cpp
--- a/mailnews/base/src/MailNewsDLF.cpp
+++ b/mailnews/base/src/MailNewsDLF.cpp
@@ -77,17 +77,17 @@ MailNewsDLF::CreateInstance(const char* 
   NS_ENSURE_SUCCESS(rv, rv);
 
   return scs->AsyncConvertData(MESSAGE_RFC822, TEXT_HTML, listener, aChannel,
                                aDocListener);
 }
 
 NS_IMETHODIMP
 MailNewsDLF::CreateInstanceForDocument(nsISupports* aContainer,
-                                       nsIDocument* aDocument,
+                                       mozilla::dom::Document* aDocument,
                                        const char* aCommand,
                                        nsIContentViewer** aDocViewer)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 }
 }
--- a/mailnews/base/src/nsMsgMailSession.cpp
+++ b/mailnews/base/src/nsMsgMailSession.cpp
@@ -9,17 +9,17 @@
 #include "nsIMsgMessageService.h"
 #include "nsMsgUtils.h"
 #include "nsIMsgAccountManager.h"
 #include "nsIChromeRegistry.h"
 #include "nsIDirectoryService.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsPIDOMWindow.h"
 #include "nsIDocShell.h"
-#include "nsIDocument.h"
+#include "mozilla/dom/Document.h"
 #include "nsIObserverService.h"
 #include "nsIAppStartup.h"
 #include "nsToolkitCompsCID.h"
 #include "nsISupportsPrimitives.h"
 #include "nsIAppShellService.h"
 #include "nsAppShellCID.h"
 #include "nsIWindowMediator.h"
 #include "nsIWindowWatcher.h"
@@ -280,17 +280,17 @@ nsresult nsMsgMailSession::GetTopmostMsg
       rv = windowEnum->GetNext(getter_AddRefs(windowSupports));
       NS_ENSURE_SUCCESS(rv, rv);
       NS_ENSURE_TRUE(windowSupports, NS_ERROR_FAILURE);
 
       topMostWindow = do_QueryInterface(windowSupports, &rv);
       NS_ENSURE_SUCCESS(rv, rv);
       NS_ENSURE_TRUE(topMostWindow, NS_ERROR_FAILURE);
 
-      nsIDocument* domDocument = topMostWindow->GetDoc();
+      mozilla::dom::Document* domDocument = topMostWindow->GetDoc();
       NS_ENSURE_TRUE(domDocument, NS_ERROR_FAILURE);
 
       Element* domElement = domDocument->GetDocumentElement();
       NS_ENSURE_TRUE(domElement, NS_ERROR_FAILURE);
 
       domElement->GetAttribute(NS_LITERAL_STRING("windowtype"), windowType);
       if (windowType.EqualsLiteral("mail:3pane") ||
           windowType.EqualsLiteral("mail:messageWindow"))
--- a/mailnews/base/src/nsMsgStatusFeedback.cpp
+++ b/mailnews/base/src/nsMsgStatusFeedback.cpp
@@ -3,17 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "msgCore.h"
 
 #include "nsIWebProgress.h"
 #include "nsIXULBrowserWindow.h"
 #include "nsMsgStatusFeedback.h"
-#include "nsIDocument.h"
+#include "mozilla/dom/Document.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIChannel.h"
 #include "prinrval.h"
 #include "nsIMsgMailNewsUrl.h"
 #include "nsIMimeMiscStatus.h"
 #include "nsIMsgWindow.h"
 #include "nsMsgUtils.h"
--- a/mailnews/compose/src/nsMsgCompUtils.cpp
+++ b/mailnews/compose/src/nsMsgCompUtils.cpp
@@ -29,17 +29,17 @@
 #include "nsMemory.h"
 #include "nsCRTGlue.h"
 #include <ctype.h>
 #include "mozilla/dom/Element.h"
 #include "mozilla/mailnews/Services.h"
 #include "mozilla/Services.h"
 #include "mozilla/Unused.h"
 #include "nsIContentIterator.h"
-#include "nsIDocument.h"
+#include "mozilla/dom/Document.h"
 #include "nsIMIMEInfo.h"
 #include "nsIMsgHeaderParser.h"
 #include "nsIMutableArray.h"
 #include "nsIRandomGenerator.h"
 #include "nsID.h"
 
 NS_IMPL_ISUPPORTS(nsMsgCompUtils, nsIMsgCompUtils)
 
@@ -1769,17 +1769,17 @@ void GetSerialiserFlags(const char* char
     // send short lines to allow 7bit transfer encoding.
     *disallowBreaks = false;
     if (*flowed)
       *delsp = true;
   }
 }
 
 already_AddRefed<nsIArray>
-GetEmbeddedObjects(nsIDocument* aDocument)
+GetEmbeddedObjects(mozilla::dom::Document* aDocument)
 {
   nsCOMPtr<nsIMutableArray> nodes = do_CreateInstance(NS_ARRAY_CONTRACTID);
   if (NS_WARN_IF(!nodes)) {
     return nullptr;
   }
 
   nsCOMPtr<nsIContentIterator> iter = NS_NewContentIterator();
   iter->Init(aDocument->GetRootElement());
--- a/mailnews/compose/src/nsMsgCompUtils.h
+++ b/mailnews/compose/src/nsMsgCompUtils.h
@@ -31,17 +31,17 @@ public:
   NS_DECL_NSIMSGCOMPUTILS
 
   nsMsgCompUtils();
 
 private:
   virtual ~nsMsgCompUtils();
 };
 
-already_AddRefed<nsIArray> GetEmbeddedObjects(nsIDocument* aDocument);
+already_AddRefed<nsIArray> GetEmbeddedObjects(mozilla::dom::Document* aDocument);
 
 PR_BEGIN_EXTERN_C
 
 //
 // Create a file spec or file name using the name passed
 // in as a template
 //
 nsresult    nsMsgCreateTempFile(const char *tFileName, nsIFile **tFile);
--- a/mailnews/compose/src/nsMsgCompose.cpp
+++ b/mailnews/compose/src/nsMsgCompose.cpp
@@ -1,15 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsMsgCompose.h"
-#include "nsIDocument.h"
+#include "mozilla/dom/Document.h"
 #include "nsPIDOMWindow.h"
 #include "mozIDOMWindow.h"
 #include "nsISelectionController.h"
 #include "nsMsgI18N.h"
 #include "nsMsgCompCID.h"
 #include "nsMsgQuote.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
@@ -297,17 +297,17 @@ bool nsMsgCompose::IsEmbeddedObjectSafe(
 nsresult nsMsgCompose::ResetUrisForEmbeddedObjects()
 {
   uint32_t numNodes;
   uint32_t i;
 
   if (!m_editor)
     return NS_ERROR_FAILURE;
 
-  nsCOMPtr<nsIDocument> document;
+  nsCOMPtr<Document> document;
   m_editor->GetDocument(getter_AddRefs(document));
   if (!document)
     return NS_ERROR_FAILURE;
   nsCOMPtr<nsIArray> aNodeList = GetEmbeddedObjects(document);
   if (!aNodeList)
     return NS_ERROR_FAILURE;
 
   if (NS_FAILED(aNodeList->GetLength(&numNodes)))
@@ -441,17 +441,17 @@ nsresult nsMsgCompose::TagEmbeddedObject
 {
   nsresult rv = NS_OK;
   uint32_t count;
   uint32_t i;
 
   if (!aEditor)
     return NS_ERROR_FAILURE;
 
-  nsCOMPtr<nsIDocument> document;
+  nsCOMPtr<Document> document;
   aEditor->GetDocument(getter_AddRefs(document));
   if (!document)
     return NS_ERROR_FAILURE;
   nsCOMPtr<nsIArray> aNodeList = GetEmbeddedObjects(document);
   if (!aNodeList)
     return NS_ERROR_FAILURE;
 
   if (NS_FAILED(aNodeList->GetLength(&count)))
@@ -525,17 +525,17 @@ nsMsgCompose::InsertDivWrappedTextAtSele
   nsCOMPtr<nsIHTMLEditor> htmlEditor(do_QueryInterface(m_editor));
 
   nsresult rv = htmlEditor->CreateElementWithDefaults(NS_LITERAL_STRING("div"),
                                                       getter_AddRefs(divElem));
 
   NS_ENSURE_SUCCESS_VOID(rv);
 
   // We need the document
-  nsCOMPtr<nsIDocument> doc;
+  nsCOMPtr<Document> doc;
   rv = m_editor->GetDocument(getter_AddRefs(doc));
   NS_ENSURE_SUCCESS_VOID(rv);
 
   // Break up the text by newlines, and then insert text nodes followed
   // by <br> nodes.
   int32_t start = 0;
   int32_t end = aText.Length();
 
@@ -5621,17 +5621,17 @@ void nsMsgCompose::_NodeTreeConvertible(
 }
 
 NS_IMETHODIMP
 nsMsgCompose::BodyConvertible(int32_t *_retval)
 {
     NS_ENSURE_ARG_POINTER(_retval);
     NS_ENSURE_STATE(m_editor);
 
-    nsCOMPtr<nsIDocument> rootDocument;
+    nsCOMPtr<Document> rootDocument;
     nsresult rv = m_editor->GetDocument(getter_AddRefs(rootDocument));
     if (NS_FAILED(rv))
       return rv;
     if (!rootDocument)
       return NS_ERROR_UNEXPECTED;
 
     // get the top level element, which contains <html>
     nsCOMPtr<Element> rootElement = rootDocument->GetDocumentElement();
--- a/mailnews/compose/src/nsMsgComposeContentHandler.cpp
+++ b/mailnews/compose/src/nsMsgComposeContentHandler.cpp
@@ -9,17 +9,17 @@
 #include "nsMsgCompCID.h"
 #include "nsIChannel.h"
 #include "nsIURI.h"
 #include "plstr.h"
 #include "nsServiceManagerUtils.h"
 #include "nsCOMPtr.h"
 #include "nsPIDOMWindow.h"
 #include "mozIDOMWindow.h"
-#include "nsIDocument.h"
+#include "mozilla/dom/Document.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIMsgMailNewsUrl.h"
 #include "nsNetUtil.h"
 #include "nsIMsgFolder.h"
 #include "nsIMsgIncomingServer.h"
 #include "nsIMsgAccountManager.h"
 
--- a/mailnews/compose/src/nsMsgComposeService.cpp
+++ b/mailnews/compose/src/nsMsgComposeService.cpp
@@ -16,17 +16,17 @@
 #include "nsXPCOM.h"
 #include "nsISupportsPrimitives.h"
 #include "nsIWindowWatcher.h"
 #include "mozIDOMWindow.h"
 #include "nsIContentViewer.h"
 #include "nsIMsgWindow.h"
 #include "nsIDocShell.h"
 #include "nsPIDOMWindow.h"
-#include "nsIDocument.h"
+#include "mozilla/dom/Document.h"
 #include "nsIXULWindow.h"
 #include "nsIWindowMediator.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIDocShellTreeOwner.h"
 #include "nsIBaseWindow.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsMsgBaseCID.h"
@@ -320,17 +320,17 @@ nsMsgComposeService::GetOrigWindowSelect
         return NS_ERROR_ABORT;
     }
   }
 
   nsCOMPtr<nsIContentViewer> contentViewer;
   rv = docShell->GetContentViewer(getter_AddRefs(contentViewer));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCOMPtr<nsIDocument> domDocument(contentViewer->GetDocument());
+  nsCOMPtr<mozilla::dom::Document> domDocument(contentViewer->GetDocument());
 
   nsCOMPtr<nsIDocumentEncoder> docEncoder = do_createHTMLCopyEncoder();
 
   rv = docEncoder->Init(domDocument, NS_LITERAL_STRING("text/html"), 0);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = docEncoder->SetSelection(sel);
   NS_ENSURE_SUCCESS(rv, rv);
--- a/mailnews/compose/src/nsMsgSend.cpp
+++ b/mailnews/compose/src/nsMsgSend.cpp
@@ -24,17 +24,17 @@
 #include "nsIURL.h"
 #include "nsNetUtil.h"
 #include "nsIFileURL.h"
 #include "nsMsgCopy.h"
 #include "nsUnicharUtils.h"
 #include "nsMsgPrompts.h"
 #include "nsCExternalHandlerService.h"
 #include "nsIMIMEService.h"
-#include "nsIDocument.h"
+#include "mozilla/dom/Document.h"
 #include "nsMsgCompCID.h"
 #include "nsIAbAddressCollector.h"
 #include "nsAbBaseCID.h"
 #include "nsCOMPtr.h"
 #include "mozITXTToHTMLConv.h"
 #include "nsIEditor.h"
 #include "nsIMsgStatusFeedback.h"
 #include "nsIMsgWindow.h"
@@ -1409,17 +1409,17 @@ nsMsgComposeAndSend::GetMultipartRelated
 
   if (mMultipartRelatedAttachmentCount != -1 && !forceToBeCalculated)
     return (uint32_t)mMultipartRelatedAttachmentCount;
 
   //First time here, let's calculate the correct number of related part we need to generate
   mMultipartRelatedAttachmentCount = 0;
   if (mEditor)
   {
-    nsCOMPtr<nsIDocument> document;
+    nsCOMPtr<mozilla::dom::Document> document;
     mEditor->GetDocument(getter_AddRefs(document));
     if (!document)
       return 0;
     mEmbeddedObjectList = GetEmbeddedObjects(document);
   }
   if (!mEmbeddedObjectList)
     return 0;
 
--- a/mailnews/import/winlivemail/nsWMSettings.cpp
+++ b/mailnews/import/winlivemail/nsWMSettings.cpp
@@ -22,44 +22,44 @@
 #include "nsISmtpService.h"
 #include "nsISmtpServer.h"
 #include "nsWMStringBundle.h"
 #include "ImportDebug.h"
 #include "nsIPop3IncomingServer.h"
 #include "nsIImapIncomingServer.h"
 #include "nsINntpIncomingServer.h"
 #include "stdlib.h"
-#include "nsIDocument.h"
+#include "mozilla/dom/Document.h"
 #include "nsIFile.h"
 #include "nsNetUtil.h"
 #include "nsTArray.h"
 #include <windows.h>
 #include "nsIWindowsRegKey.h"
 #include "nsCOMArray.h"
 #include "nsWMUtils.h"
 
 class WMSettings {
 public:
   static bool DoImport(nsIMsgAccount **ppAccount);
   static bool DoIMAPServer(nsIMsgAccountManager *pMgr,
-                             nsIDocument *xmlDoc,
+                             mozilla::dom::Document *xmlDoc,
                              const nsString& serverName,
                              nsIMsgAccount **ppAccount);
   static bool DoPOP3Server(nsIMsgAccountManager *pMgr,
-                             nsIDocument *xmlDoc,
+                             mozilla::dom::Document *xmlDoc,
                              const nsString& serverName,
                              nsIMsgAccount **ppAccount);
   static bool DoNNTPServer(nsIMsgAccountManager *pMgr,
-                             nsIDocument *xmlDoc,
+                             mozilla::dom::Document *xmlDoc,
                              const nsString& serverName,
                              nsIMsgAccount **ppAccount);
   static void SetIdentities(nsIMsgAccountManager *pMgr, nsIMsgAccount *pAcc,
-                            nsIDocument *xmlDoc, nsAutoString &userName,
+                            mozilla::dom::Document *xmlDoc, nsAutoString &userName,
                             int32_t authMethodIncoming, bool isNNTP);
-  static void SetSmtpServer(nsIDocument *xmlDoc, nsIMsgIdentity *id,
+  static void SetSmtpServer(mozilla::dom::Document *xmlDoc, nsIMsgIdentity *id,
                             nsAutoString& inUserName, int32_t authMethodIncoming);
 };
 
 static int32_t checkNewMailTime;// WM global setting, let's default to 30
 static bool    checkNewMail;    // WM global setting, let's default to false
                                 // This won't cause unwanted autodownloads-
                                 // user can set prefs after import
 
@@ -166,17 +166,17 @@ bool WMSettings::DoImport(nsIMsgAccount 
   if (NS_FAILED(nsWMUtils::GetOEAccountFiles(fileArray))) {
     IMPORT_LOG0("*** Failed to get .oeaccount file!\n");
     return false;
   }
 
   // Loop through *.oeaccounts files looking for POP3 & IMAP & NNTP accounts
   // Ignore LDAP for now!
   int accounts = 0;
-  nsCOMPtr<nsIDocument> xmlDoc;
+  nsCOMPtr<mozilla::dom::Document> xmlDoc;
 
   for (int32_t i = fileArray.Count() - 1 ; i >= 0; i--){
     nsWMUtils::MakeXMLdoc(getter_AddRefs(xmlDoc), fileArray[i]);
 
     nsAutoCString name;
     fileArray[i]->GetNativeLeafName(name);
     nsAutoString value;
     nsCOMPtr<nsIMsgAccount> anAccount;
@@ -208,17 +208,17 @@ bool WMSettings::DoImport(nsIMsgAccount 
   // Now save the new acct info to pref file.
   rv = accMgr->SaveAccountInfo();
   NS_ASSERTION(NS_SUCCEEDED(rv), "Can't save account info to pref file");
 
   return accounts != 0;
 }
 
 bool WMSettings::DoIMAPServer(nsIMsgAccountManager *pMgr,
-                                nsIDocument *xmlDoc,
+                                mozilla::dom::Document *xmlDoc,
                                 const nsString& serverName,
                                 nsIMsgAccount **ppAccount)
 {
   int32_t authMethod;   // Secure Password Authentication (SPA)
   nsresult errorCode;
   if (ppAccount)
     *ppAccount = nullptr;
 
@@ -317,17 +317,17 @@ bool WMSettings::DoIMAPServer(nsIMsgAcco
     }
   }
   else
     result = true;
   return result;
 }
 
 bool WMSettings::DoPOP3Server(nsIMsgAccountManager *pMgr,
-                                nsIDocument *xmlDoc,
+                                mozilla::dom::Document *xmlDoc,
                                 const nsString& serverName,
                                 nsIMsgAccount **ppAccount)
 {
   int32_t authMethod;   // Secure Password Authentication (SPA)
   nsresult errorCode;
   if (ppAccount)
     *ppAccount = nullptr;
 
@@ -478,17 +478,17 @@ bool WMSettings::DoPOP3Server(nsIMsgAcco
     }
   }
   else
     result = true;
   return result;
 }
 
 bool WMSettings::DoNNTPServer(nsIMsgAccountManager *pMgr,
-                                nsIDocument *xmlDoc,
+                                mozilla::dom::Document *xmlDoc,
                                 const nsString& serverName,
                                 nsIMsgAccount **ppAccount)
 {
   int32_t authMethod;
   nsresult errorCode;
   if (ppAccount)
     *ppAccount = nullptr;
 
@@ -581,17 +581,17 @@ bool WMSettings::DoNNTPServer(nsIMsgAcco
     }
   }
   else
     result = true;
   return result;
 }
 
 void WMSettings::SetIdentities(nsIMsgAccountManager *pMgr, nsIMsgAccount *pAcc,
-                               nsIDocument *xmlDoc, nsAutoString &inUserName,
+                               mozilla::dom::Document *xmlDoc, nsAutoString &inUserName,
                                int32_t authMethodIncoming, bool isNNTP)
 {
   // Get the relevant information for an identity
   nsresult rv;
   nsAutoString value;
 
   nsCOMPtr<nsIMsgIdentity> id;
   rv = pMgr->CreateIdentity(getter_AddRefs(id));
@@ -635,17 +635,17 @@ void WMSettings::SetIdentities(nsIMsgAcc
     id->SetReplyOnTop(isNNTP ? 0 : 1);
     pAcc->AddIdentity(id);
   }
 
   if (!isNNTP)  // NNTP does not use SMTP in OE or TB
     SetSmtpServer(xmlDoc, id, inUserName, authMethodIncoming);
 }
 
-void WMSettings::SetSmtpServer(nsIDocument *xmlDoc, nsIMsgIdentity *id,
+void WMSettings::SetSmtpServer(mozilla::dom::Document *xmlDoc, nsIMsgIdentity *id,
                                nsAutoString& inUserName, int32_t authMethodIncoming)
 {
   nsresult errorCode;
 
   // set the id.smtpserver accordingly
   if (!id)
     return;
   nsCString smtpServerKey, userName;
--- a/mailnews/import/winlivemail/nsWMUtils.cpp
+++ b/mailnews/import/winlivemail/nsWMUtils.cpp
@@ -2,18 +2,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
   * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsCOMArray.h"
 #include "nsCOMPtr.h"
 #include "nsComponentManagerUtils.h"
 #include "nsNetCID.h"
 #include "nsString.h"
+#include "mozilla/dom/Document.h"
 #include "nsWMUtils.h"
-#include "nsIDocument.h"
 #include "nsINodeList.h"
 #include "nsContentList.h"
 #include "nsINode.h"
 #include "nsIFileStreams.h"
 #include "nsIFile.h"
 #include "nsIDirectoryEnumerator.h"
 #include "ImportDebug.h"
 #include "prio.h"
@@ -122,41 +122,41 @@ nsWMUtils::GetOEAccountFilesInFolder(nsI
       if (StringEndsWith(name, NS_LITERAL_STRING(".oeaccount")))
         aFileArray.AppendObject(file);
     }
   }
   return NS_OK;
 }
 
 nsresult
-nsWMUtils::MakeXMLdoc(nsIDocument **aXmlDoc,
+nsWMUtils::MakeXMLdoc(mozilla::dom::Document **aXmlDoc,
                       nsIFile *aFile)
 {
   nsresult rv;
   nsCOMPtr<nsIFileInputStream> stream =
     do_CreateInstance(NS_LOCALFILEINPUTSTREAM_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = stream->Init(aFile, PR_RDONLY, -1, 0);
   mozilla::ErrorResult rv2;
   RefPtr<mozilla::dom::DOMParser> parser = mozilla::dom::DOMParser::CreateWithoutGlobal(rv2);
   if (rv2.Failed()) {
     return rv2.StealNSResult();
   }
   int64_t filesize;
   aFile->GetFileSize(&filesize);
-  nsCOMPtr<nsIDocument> xmldoc =
+  nsCOMPtr<mozilla::dom::Document> xmldoc =
     parser->ParseFromStream(stream, EmptyString(), int32_t(filesize),
                             mozilla::dom::SupportedType::Application_xml, rv2);
   xmldoc.forget(aXmlDoc);
   return rv2.StealNSResult();
 }
 
 nsresult
-nsWMUtils::GetValueForTag(nsIDocument *aXmlDoc,
+nsWMUtils::GetValueForTag(mozilla::dom::Document *aXmlDoc,
                           const char *aTagName,
                           nsAString &aValue)
 {
   nsAutoString tagName;
   tagName.AssignASCII(aTagName);
   nsCOMPtr<nsINodeList> list = aXmlDoc->GetElementsByTagName(tagName);
   nsCOMPtr<nsINode> node = list->Item(0);
   if (!node)
--- a/mailnews/import/winlivemail/nsWMUtils.h
+++ b/mailnews/import/winlivemail/nsWMUtils.h
@@ -2,24 +2,23 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
   * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsWMUtils_h___
 #define nsWMUtils_h___
 
 #include <windows.h>
 #include "nsIWindowsRegKey.h"
-class nsIDocument;
 
 class nsWMUtils {
 public:
   static nsresult FindWMKey(nsIWindowsRegKey **aKey);
   static nsresult GetRootFolder(nsIFile **aRootFolder);
   static nsresult GetOEAccountFiles(nsCOMArray<nsIFile> &aFileArray);
   static nsresult GetOEAccountFilesInFolder(nsIFile *aFolder,
                                             nsCOMArray<nsIFile> &aFileArray);
-  static nsresult MakeXMLdoc(nsIDocument **aXmlDoc, nsIFile *aFile);
-  static nsresult GetValueForTag(nsIDocument *aXmlDoc,
+  static nsresult MakeXMLdoc(mozilla::dom::Document **aXmlDoc, nsIFile *aFile);
+  static nsresult GetValueForTag(mozilla::dom::Document *aXmlDoc,
                                  const char *aTagName,
                                  nsAString &aValue);
 };
 
 #endif /* nsWMUtils_h___ */
--- a/mailnews/mime/src/mimeTextHTMLParsed.cpp
+++ b/mailnews/mime/src/mimeTextHTMLParsed.cpp
@@ -18,17 +18,17 @@
    That would remove the need for this workaround, and stop even more attack classes.
 */
 
 #include "mimeTextHTMLParsed.h"
 #include "prmem.h"
 #include "prlog.h"
 #include "msgCore.h"
 #include "mozilla/dom/DOMParser.h"
-#include "nsIDocument.h"
+#include "mozilla/dom/Document.h"
 #include "nsIDocumentEncoder.h"
 #include "mozilla/ErrorResult.h"
 #include "mimethtm.h"
 
 #define MIME_SUPERCLASS mimeInlineTextHTMLClass
 MimeDefClass(MimeInlineTextHTMLParsed, MimeInlineTextHTMLParsedClass,
              mimeInlineTextHTMLParsedClass, &MIME_SUPERCLASS);
 
@@ -86,17 +86,17 @@ MimeInlineTextHTMLParsed_parse_eof(MimeO
     return 0;
   nsString parsed;
   nsresult rv;
 
   // Parse the HTML source.
   mozilla::ErrorResult rv2;
   RefPtr<mozilla::dom::DOMParser> parser =
     mozilla::dom::DOMParser::CreateWithoutGlobal(rv2);
-  nsCOMPtr<nsIDocument> document = parser->ParseFromString(
+  nsCOMPtr<mozilla::dom::Document> document = parser->ParseFromString(
     rawHTML, mozilla::dom::SupportedType::Text_html, rv2);
   if (rv2.Failed())
     return -1;
 
   // Serialize it back to HTML source again.
   nsCOMPtr<nsIDocumentEncoder> encoder = do_createDocumentEncoder("text/html");
   NS_ENSURE_TRUE(encoder, -1);
   uint32_t aFlags = nsIDocumentEncoder::OutputRaw |