Bug 1313986 - Part 5. Remove createAnonymousElement from nsIHTMLEditor. r=masayuki
c-c nor add-ons seem noet to use it. We should remove this.
MozReview-Commit-ID: 3jN8kUp6D4Z
--- a/editor/libeditor/HTMLAnonymousNodeEditor.cpp
+++ b/editor/libeditor/HTMLAnonymousNodeEditor.cpp
@@ -156,42 +156,16 @@ ElementDeletionObserver::NodeWillBeDestr
mNativeAnonNode->RemoveMutationObserver(this);
mNativeAnonNode->UnbindFromTree();
mNativeAnonNode = nullptr;
}
NS_RELEASE_THIS();
}
-// Returns in *aReturn an anonymous nsDOMElement of type aTag,
-// child of aParentNode. If aIsCreatedHidden is true, the class
-// "hidden" is added to the created element. If aAnonClass is not
-// the empty string, it becomes the value of the attribute "_moz_anonclass"
-NS_IMETHODIMP
-HTMLEditor::CreateAnonymousElement(const nsAString& aTag,
- nsIDOMNode* aParentNode,
- const nsAString& aAnonClass,
- bool aIsCreatedHidden,
- nsIDOMElement** aReturn)
-{
- NS_ENSURE_ARG_POINTER(aReturn);
- *aReturn = nullptr;
-
- nsCOMPtr<nsIAtom> atom = NS_Atomize(aTag);
- RefPtr<Element> element =
- CreateAnonymousElement(atom, aParentNode, aAnonClass, aIsCreatedHidden);
- if (NS_WARN_IF(!element)) {
- return NS_ERROR_FAILURE;
- }
- nsCOMPtr<nsIDOMElement> newElement =
- static_cast<nsIDOMElement*>(GetAsDOMNode(element));
- newElement.forget(aReturn);
- return NS_OK;
-}
-
already_AddRefed<Element>
HTMLEditor::CreateAnonymousElement(nsIAtom* aTag,
nsIDOMNode* aParentNode,
const nsAString& aAnonClass,
bool aIsCreatedHidden)
{
if (NS_WARN_IF(!aParentNode)) {
return nullptr;
--- a/editor/nsIHTMLEditor.idl
+++ b/editor/nsIHTMLEditor.idl
@@ -505,34 +505,16 @@ interface nsIHTMLEditor : nsISupports
/**
* Remove listener for insertion override
* @param inFilter function which callers do not want called during insertion
*/
void removeInsertionListener(in nsIContentFilter inFilter);
/**
- * Returns an anonymous nsDOMElement of type aTag,
- * child of aParentNode. If aIsCreatedHidden is true, the class
- * "hidden" is added to the created element. If aAnonClass is not
- * the empty string, it becomes the value of the attribute "_moz_anonclass"
- * @return a DOM Element
- * @param aTag [IN] a string representing the desired type of
- * the element to create
- * @param aParentNode [IN] the parent node of the created anonymous
- * element
- * @param aAnonClass [IN] contents of the _moz_anonclass attribute
- * @param aIsCreatedHidden [IN] a boolean specifying if the class "hidden"
- * is to be added to the created anonymous
- * element
- */
- nsIDOMElement createAnonymousElement(in AString aTag, in nsIDOMNode aParentNode,
- in AString aAnonClass, in boolean aIsCreatedHidden);
-
- /**
* returns the deepest container of the selection
* @return a DOM Element
*/
nsIDOMElement getSelectionContainer();
/**
* Checks if the anonymous nodes created by the HTML editor have to be
* refreshed or hidden depending on a possible new state of the selection