Bug 1664411 - Factor out a condition to unconditionally enable clipboard events in some documents. r=masayuki

This patch shouldn't introduce any behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D89834
This commit is contained in:
Emilio Cobos Álvarez
2020-09-11 11:08:35 +00:00
parent d50a734248
commit 2e179aba86
7 changed files with 26 additions and 20 deletions

View File

@@ -664,10 +664,7 @@ nsresult TextEditor::PasteTransferableAsAction(nsITransferable* aTransferable,
}
bool TextEditor::CanPaste(int32_t aClipboardType) const {
// Always enable the paste command when inside of a HTML or XHTML document,
// but if the document is chrome, let it control it.
RefPtr<Document> doc = GetDocument();
if (doc && doc->IsHTMLOrXHTML() && !nsContentUtils::IsChromeDoc(doc)) {
if (AreClipboardCommandsUnconditionallyEnabled()) {
return true;
}