summaryrefslogtreecommitdiffstats
path: root/editor/libeditor/TextEditorDataTransfer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/libeditor/TextEditorDataTransfer.cpp')
-rw-r--r--editor/libeditor/TextEditorDataTransfer.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/editor/libeditor/TextEditorDataTransfer.cpp b/editor/libeditor/TextEditorDataTransfer.cpp
index 0388aa4a8..2cc2906fa 100644
--- a/editor/libeditor/TextEditorDataTransfer.cpp
+++ b/editor/libeditor/TextEditorDataTransfer.cpp
@@ -383,6 +383,13 @@ TextEditor::CanPaste(int32_t aSelectionType,
NS_ENSURE_ARG_POINTER(aCanPaste);
*aCanPaste = false;
+ // Always enable the paste command when inside of a HTML or XHTML document.
+ nsCOMPtr<nsIDocument> doc = GetDocument();
+ if (doc && doc->IsHTMLOrXHTML()) {
+ *aCanPaste = true;
+ return NS_OK;
+ }
+
// can't paste if readonly
if (!IsModifiable()) {
return NS_OK;