Bug 1434515 - Port bug 1434318: Replace various uses of IDOMDocument (one more). rs=bustage-fix
authorJorg K <jorgk@jorgk.com>
Thu, 01 Feb 2018 00:58:42 +0100
changeset 31018 4ec396880934708b6f24798c54510e2c68716d81
parent 31017 173984b4516a0d3b16870b6dd321d8c0a2f4ee1f
child 31019 de00262fbce6484492bf2289acb3db105f380a40
push id383
push userclokep@gmail.com
push dateMon, 07 May 2018 21:52:48 +0000
reviewersbustage-fix
bugs1434515, 1434318
Bug 1434515 - Port bug 1434318: Replace various uses of IDOMDocument (one more). rs=bustage-fix
mailnews/compose/src/nsMsgCompose.cpp
--- a/mailnews/compose/src/nsMsgCompose.cpp
+++ b/mailnews/compose/src/nsMsgCompose.cpp
@@ -5574,23 +5574,19 @@ nsMsgCompose::BodyConvertible(int32_t *_
     NS_ENSURE_STATE(m_editor);
 
     nsCOMPtr<nsIDOMDocument> rootDocument;
     nsresult rv = m_editor->GetDocument(getter_AddRefs(rootDocument));
     if (NS_FAILED(rv) || !rootDocument)
       return rv;
 
     // get the top level element, which contains <html>
-    nsCOMPtr<nsIDOMElement> rootElement;
-    rv = rootDocument->GetDocumentElement(getter_AddRefs(rootElement));
-    if (NS_FAILED(rv) || !rootElement)
-      return rv;
-
-    nsCOMPtr<Element> rootElement2 = do_QueryInterface(rootElement);
-    return _NodeTreeConvertible(rootElement2, _retval);
+    nsCOMPtr<nsIDocument> rootDocument2 = do_QueryInterface(rootDocument);
+    nsCOMPtr<Element> rootElement = rootDocument2->GetDocumentElement();
+    return _NodeTreeConvertible(rootElement, _retval);
 }
 
 NS_IMETHODIMP
 nsMsgCompose::GetIdentity(nsIMsgIdentity **aIdentity)
 {
   NS_ENSURE_ARG_POINTER(aIdentity);
   NS_IF_ADDREF(*aIdentity = m_identity);
   return NS_OK;