Bug 1490192 - Get rid of nsIEditorMailSupport.getEmbeddedObjects. r=masayuki
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Tue, 11 Sep 2018 07:24:27 +0000
changeset 435623 a9d1434153504627fe6d72465b799a74201788f4
parent 435622 22a22b0a2d4885b74c52444abeb1998b3e19f664
child 435624 1133e8b0513781b8e4bde79e41678b0551fc00a2
push id69077
push userm_kato@ga2.so-net.ne.jp
push dateTue, 11 Sep 2018 08:15:11 +0000
treeherderautoland@a9d143415350 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1490192, 1478546
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1490192 - Get rid of nsIEditorMailSupport.getEmbeddedObjects. r=masayuki Since I have landed bug 1478546, no one (inc. bluegriffon) uses this method. Differential Revision: https://phabricator.services.mozilla.com/D5497
editor/libeditor/HTMLEditor.cpp
editor/nsIEditorMailSupport.idl
--- a/editor/libeditor/HTMLEditor.cpp
+++ b/editor/libeditor/HTMLEditor.cpp
@@ -3298,60 +3298,16 @@ HTMLEditor::GetStyleSheetForURL(const ns
   if (foundIndex == mStyleSheetURLs.NoIndex) {
     return nullptr;
   }
 
   MOZ_ASSERT(mStyleSheets[foundIndex]);
   return mStyleSheets[foundIndex];
 }
 
-NS_IMETHODIMP
-HTMLEditor::GetEmbeddedObjects(nsIArray** aNodeList)
-{
-  if (NS_WARN_IF(!aNodeList)) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  nsresult rv;
-  nsCOMPtr<nsIMutableArray> nodes = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-
-  nsCOMPtr<nsIContentIterator> iter = NS_NewContentIterator();
-
-  nsCOMPtr<nsIDocument> doc = GetDocument();
-  if (NS_WARN_IF(!doc)) {
-    return NS_ERROR_UNEXPECTED;
-  }
-
-  iter->Init(doc->GetRootElement());
-
-  // Loop through the content iterator for each content node.
-  while (!iter->IsDone()) {
-    nsINode* node = iter->GetCurrentNode();
-    if (node->IsElement()) {
-      dom::Element* element = node->AsElement();
-
-      // See if it's an image or an embed and also include all links.
-      // Let mail decide which link to send or not
-      if (element->IsAnyOfHTMLElements(nsGkAtoms::img, nsGkAtoms::embed,
-                                       nsGkAtoms::a) ||
-          (element->IsHTMLElement(nsGkAtoms::body) &&
-           element->HasAttr(kNameSpaceID_None, nsGkAtoms::background))) {
-        nodes->AppendElement(node);
-       }
-     }
-     iter->Next();
-   }
-
-  nodes.forget(aNodeList);
-  return NS_OK;
-}
-
 nsresult
 HTMLEditor::DeleteSelectionWithTransaction(EDirection aAction,
                                            EStripWrappers aStripWrappers)
 {
   MOZ_ASSERT(aStripWrappers == eStrip || aStripWrappers == eNoStrip);
 
   nsresult rv =
     TextEditor::DeleteSelectionWithTransaction(aAction, aStripWrappers);
--- a/editor/nsIEditorMailSupport.idl
+++ b/editor/nsIEditorMailSupport.idl
@@ -53,15 +53,10 @@ interface nsIEditorMailSupport : nsISupp
                               in AString aCitation,
                               in boolean aInsertHTML);
 
   /**
    * Rewrap the selected part of the document, re-quoting if necessary.
    * @param aRespectNewlines  Try to maintain newlines in the original?
    */
   void rewrap(in boolean aRespectNewlines);
-
-  /**
-   * Get a list of IMG and OBJECT tags in the current document.
-   */
-  nsIArray getEmbeddedObjects();
 };