diff --git a/editor/libeditor/EditorBase.cpp b/editor/libeditor/EditorBase.cpp index de149ec934d8..38d20e21d5f4 100644 --- a/editor/libeditor/EditorBase.cpp +++ b/editor/libeditor/EditorBase.cpp @@ -662,9 +662,7 @@ bool EditorBase::IsSelectionEditable() { // XXX we just check that the anchor node is editable at the moment // we should check that all nodes in the selection are editable nsCOMPtr anchorNode = SelectionRefPtr()->GetAnchorNode(); - return anchorNode && anchorNode->IsContent() && - EditorUtils::IsEditableContent(*anchorNode->AsContent(), - GetEditorType()); + return anchorNode && anchorNode->IsContent() && anchorNode->IsEditable(); } nsINode* anchorNode = SelectionRefPtr()->GetAnchorNode(); diff --git a/editor/libeditor/tests/mochitest.ini b/editor/libeditor/tests/mochitest.ini index e219c864caa1..d5373f4c50d2 100644 --- a/editor/libeditor/tests/mochitest.ini +++ b/editor/libeditor/tests/mochitest.ini @@ -266,6 +266,7 @@ skip-if = os == 'android' [test_middle_click_paste.html] skip-if = headless [test_nsIEditor_insertLineBreak.html] +[test_nsIEditor_isSelectionEditable.html] [test_nsIEditorMailSupport_insertAsCitedQuotation.html] [test_nsIHTMLEditor_getElementOrParentByTagName.html] [test_nsIHTMLEditor_getParagraphState.html] diff --git a/editor/libeditor/tests/test_nsIEditor_isSelectionEditable.html b/editor/libeditor/tests/test_nsIEditor_isSelectionEditable.html new file mode 100644 index 000000000000..92c4ba1aee48 --- /dev/null +++ b/editor/libeditor/tests/test_nsIEditor_isSelectionEditable.html @@ -0,0 +1,16 @@ + +Test for nsIEditor.isSelectionEditable + + + + +