From 5017e990c8a7f8449b6f6e0fd3726f7e2131b28d Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Mon, 28 Jun 2021 12:08:51 +0000 Subject: [PATCH] Bug 1717178 - part 6: Get rid of `nsIHTMLEditor.setCaretAfterElement()` because of unused r=m_kato Depends on D118801 Differential Revision: https://phabricator.services.mozilla.com/D118802 --- editor/libeditor/HTMLEditor.cpp | 17 -- editor/libeditor/tests/mochitest.ini | 1 - ...st_nsIHTMLEditor_setCaretAfterElement.html | 149 ------------------ editor/nsIHTMLEditor.idl | 14 -- 4 files changed, 181 deletions(-) delete mode 100644 editor/libeditor/tests/test_nsIHTMLEditor_setCaretAfterElement.html diff --git a/editor/libeditor/HTMLEditor.cpp b/editor/libeditor/HTMLEditor.cpp index 6a0865588c0f..2a85cde501b3 100644 --- a/editor/libeditor/HTMLEditor.cpp +++ b/editor/libeditor/HTMLEditor.cpp @@ -1933,23 +1933,6 @@ nsresult HTMLEditor::SelectContentInternal(nsIContent& aContentToSelect) { return error.StealNSResult(); } -MOZ_CAN_RUN_SCRIPT_BOUNDARY NS_IMETHODIMP -HTMLEditor::SetCaretAfterElement(Element* aElement) { - if (NS_WARN_IF(!aElement)) { - return NS_ERROR_INVALID_ARG; - } - - AutoEditActionDataSetter editActionData(*this, EditAction::eNotEditing); - if (NS_WARN_IF(!editActionData.CanHandle())) { - return NS_ERROR_NOT_INITIALIZED; - } - - nsresult rv = CollapseSelectionAfter(*aElement); - NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), - "HTMLEditor::CollapseSelectionAfter() failed"); - return rv; -} - nsresult HTMLEditor::CollapseSelectionAfter(Element& aElement) { MOZ_ASSERT(IsEditActionDataAvailable()); diff --git a/editor/libeditor/tests/mochitest.ini b/editor/libeditor/tests/mochitest.ini index ada4a8f30790..7336a20c43e0 100644 --- a/editor/libeditor/tests/mochitest.ini +++ b/editor/libeditor/tests/mochitest.ini @@ -278,7 +278,6 @@ skip-if = headless [test_nsIHTMLEditor_removeInlineProperty.html] [test_nsIHTMLEditor_selectElement.html] [test_nsIHTMLEditor_setBackgroundColor.html] -[test_nsIHTMLEditor_setCaretAfterElement.html] [test_nsIHTMLObjectResizer_hideResizers.html] [test_nsITableEditor_deleteTableCell.html] [test_nsITableEditor_deleteTableCellContents.html] diff --git a/editor/libeditor/tests/test_nsIHTMLEditor_setCaretAfterElement.html b/editor/libeditor/tests/test_nsIHTMLEditor_setCaretAfterElement.html deleted file mode 100644 index ff6bc4094b9e..000000000000 --- a/editor/libeditor/tests/test_nsIHTMLEditor_setCaretAfterElement.html +++ /dev/null @@ -1,149 +0,0 @@ - - - - Test for nsIHTMLEditor.setCaretAfterElement() - - - - -
-
-
-
-
- - - - - diff --git a/editor/nsIHTMLEditor.idl b/editor/nsIHTMLEditor.idl index 1d30ac437e61..4652abc57cb7 100644 --- a/editor/nsIHTMLEditor.idl +++ b/editor/nsIHTMLEditor.idl @@ -154,20 +154,6 @@ interface nsIHTMLEditor : nsISupports [can_run_script] void selectElement(in Element aElement); - /** - * Create a collapsed selection just after aElement - * - * XXX could we parameterize SelectElement(before/select/after>? - * - * The selection is set to parent-of-aElement with an - * offset 1 greater than aElement's offset - * but it enforces the HTML 4.0 DTD "CanContain" rules, so it should - * be useful for other elements. - * - * @param aElement An element in the document - */ - void setCaretAfterElement(in Element aElement); - /** * getParagraphState returns what block tag paragraph format is in * the selection.