moebius#56: Fix: DataTransfer - Pasting image from clipboard fails in some cases

https://github.com/MoonchildProductions/moebius/pull/56
This commit is contained in:
janekptacijarabaci 2018-04-20 22:54:26 +02:00 committed by Roy Tam
commit 37c73e0634
13 changed files with 156 additions and 44 deletions

View file

@ -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;