Skip to content

Commit

Permalink
Bug 1577969 - Get rid of nsIHTMLEditor.getLinkedObject and nsIURIRefO…
Browse files Browse the repository at this point in the history
…bject. r=masayuki

Since bug 1577443 is landed in comm-central, no one uses `nsIHTMLEditor.getLinkedObject`.

Differential Revision: https://phabricator.services.mozilla.com/D44361

--HG--
extra : moz-landing-system : lando
  • Loading branch information
makotokato committed Sep 2, 2019
1 parent 0695077 commit 9d24379
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 390 deletions.
35 changes: 0 additions & 35 deletions editor/libeditor/HTMLEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "HTMLEditorEventListener.h"
#include "HTMLEditRules.h"
#include "HTMLEditUtils.h"
#include "HTMLURIRefObject.h"
#include "TextEditUtils.h"
#include "TypeInState.h"

Expand All @@ -38,7 +37,6 @@
#include "mozilla/css/Loader.h"

#include "nsIContent.h"
#include "nsIMutableArray.h"
#include "nsContentUtils.h"
#include "nsIDocumentEncoder.h"
#include "nsGenericHTMLElement.h"
Expand Down Expand Up @@ -3047,39 +3045,6 @@ nsresult HTMLEditor::SetHTMLBackgroundColorWithTransaction(
*rootElementOfBackgroundColor, *nsGkAtoms::bgcolor);
}

NS_IMETHODIMP
HTMLEditor::GetLinkedObjects(nsIArray** aNodeList) {
NS_ENSURE_TRUE(aNodeList, NS_ERROR_NULL_POINTER);

nsresult rv;
nsCOMPtr<nsIMutableArray> nodes = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}

RefPtr<Document> doc = GetDocument();
NS_ENSURE_TRUE(doc, NS_ERROR_UNEXPECTED);

PostContentIterator postOrderIter;
postOrderIter.Init(doc->GetRootElement());

// loop through the content iterator for each content node
for (; !postOrderIter.IsDone(); postOrderIter.Next()) {
nsCOMPtr<nsINode> node = postOrderIter.GetCurrentNode();
if (node) {
// Let nsURIRefObject make the hard decisions:
nsCOMPtr<nsIURIRefObject> refObject;
rv = NS_NewHTMLURIRefObject(getter_AddRefs(refObject), node);
if (NS_SUCCEEDED(rv)) {
nodes->AppendElement(refObject);
}
}
}

nodes.forget(aNodeList);
return NS_OK;
}

NS_IMETHODIMP
HTMLEditor::AddOverrideStyleSheet(const nsAString& aURL) {
AutoEditActionDataSetter editActionData(*this,
Expand Down
252 changes: 0 additions & 252 deletions editor/libeditor/HTMLURIRefObject.cpp

This file was deleted.

49 changes: 0 additions & 49 deletions editor/libeditor/HTMLURIRefObject.h

This file was deleted.

1 change: 0 additions & 1 deletion editor/libeditor/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ UNIFIED_SOURCES += [
'HTMLInlineTableEditor.cpp',
'HTMLStyleEditor.cpp',
'HTMLTableEditor.cpp',
'HTMLURIRefObject.cpp',
'InsertNodeTransaction.cpp',
'InsertTextTransaction.cpp',
'InternetCiter.cpp',
Expand Down
1 change: 0 additions & 1 deletion editor/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ XPIDL_SOURCES += [
'nsIHTMLObjectResizer.idl',
'nsIPlaintextEditor.idl',
'nsITableEditor.idl',
'nsIURIRefObject.idl',
]

XPIDL_MODULE = 'editor'
Expand Down
10 changes: 0 additions & 10 deletions editor/nsIHTMLEditor.idl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "domstubs.idl"

interface nsIContent;
interface nsIArray;

webidl Document;
webidl Element;
Expand Down Expand Up @@ -389,15 +388,6 @@ interface nsIHTMLEditor : nsISupports
[can_run_script]
void setBackgroundColor(in AString aColor);

/**
* Find all the nodes in the document which contain references
* to outside URIs (e.g. a href, img src, script src, etc.)
* The objects in the array will be type nsIURIRefObject.
*
* @return aNodeList the linked nodes found
*/
nsIArray getLinkedObjects();

/**
* A boolean which is true is the HTMLEditor has been instantiated
* with CSS knowledge and if the CSS pref is currently checked
Expand Down
Loading

0 comments on commit 9d24379

Please sign in to comment.