diff --git a/dom/html/nsHTMLDocument.cpp b/dom/html/nsHTMLDocument.cpp index 9116dfad082e..74edafe6546c 100644 --- a/dom/html/nsHTMLDocument.cpp +++ b/dom/html/nsHTMLDocument.cpp @@ -3534,6 +3534,14 @@ nsHTMLDocument::QueryCommandSupported(const nsAString & commandID, bool nsHTMLDocument::QueryCommandSupported(const nsAString& commandID) { + // Gecko technically supports the paste command, but non-privileged content + // will be unable to call it. For that reason, we report that paste is + // not supported to this non-privileged content (as it effectively is). + bool restricted = commandID.LowerCaseEqualsLiteral("paste"); + if (restricted && !nsContentUtils::IsCallerChrome()) { + return false; + } + // commandID is supported if it can be converted to a Midas command nsAutoCString cmdToDispatch; return ConvertToMidasInternalCommand(commandID, cmdToDispatch); diff --git a/dom/tests/mochitest/general/mochitest.ini b/dom/tests/mochitest/general/mochitest.ini index a9c9a9579280..d1368823c964 100644 --- a/dom/tests/mochitest/general/mochitest.ini +++ b/dom/tests/mochitest/general/mochitest.ini @@ -100,3 +100,4 @@ skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop spec skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage [test_navigation_timing.html] skip-if = buildapp == 'b2g' || buildapp == 'mulet' +[test_bug1161721.html] diff --git a/dom/tests/mochitest/general/test_bug1161721.html b/dom/tests/mochitest/general/test_bug1161721.html new file mode 100644 index 000000000000..3e59dd81b637 --- /dev/null +++ b/dom/tests/mochitest/general/test_bug1161721.html @@ -0,0 +1,32 @@ + + + + + Test for Bug 1161721 + + + + + + +Mozilla Bug 1161721 +

+ +
+
+ +
+  
+
+ + diff --git a/editor/libeditor/tests/browserscope/lib/richtext2/currentStatus.js b/editor/libeditor/tests/browserscope/lib/richtext2/currentStatus.js index b8d145b08d7b..570587e208d6 100644 --- a/editor/libeditor/tests/browserscope/lib/richtext2/currentStatus.js +++ b/editor/libeditor/tests/browserscope/lib/richtext2/currentStatus.js @@ -289,6 +289,9 @@ const knownFailures = { "Q-Proposed-UNBOOKMARK_TEXT-1-dM": true, "Q-Proposed-UNBOOKMARK_TEXT-1-body": true, "Q-Proposed-UNBOOKMARK_TEXT-1-div": true, + "Q-Proposed-PASTE_TEXT-1-dM": true, + "Q-Proposed-PASTE_TEXT-1-body": true, + "Q-Proposed-PASTE_TEXT-1-div": true, "QE-Proposed-UNSELECT_TEXT-1-dM": true, "QE-Proposed-UNSELECT_TEXT-1-body": true, "QE-Proposed-UNSELECT_TEXT-1-div": true,