mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 392159 Use nsIClipboard::SupportsSelectionClipboard() instead of #ifdef in nsEditorEventListener r=ehsan
This commit is contained in:
parent
1982b3b385
commit
145d565bb0
@ -590,13 +590,16 @@ nsEditorEventListener::MouseClick(nsIDOMEvent* aMouseEvent)
|
||||
if (ctrlKey)
|
||||
mailEditor = do_QueryObject(mEditor);
|
||||
|
||||
PRInt32 clipboard;
|
||||
|
||||
#if defined(XP_OS2) || defined(XP_WIN32)
|
||||
clipboard = nsIClipboard::kGlobalClipboard;
|
||||
#else
|
||||
clipboard = nsIClipboard::kSelectionClipboard;
|
||||
#endif
|
||||
PRInt32 clipboard = nsIClipboard::kGlobalClipboard;
|
||||
nsCOMPtr<nsIClipboard> clipboardService =
|
||||
do_GetService("@mozilla.org/widget/clipboard;1", &rv);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
bool selectionSupported;
|
||||
rv = clipboardService->SupportsSelectionClipboard(&selectionSupported);
|
||||
if (NS_SUCCEEDED(rv) && selectionSupported) {
|
||||
clipboard = nsIClipboard::kSelectionClipboard;
|
||||
}
|
||||
}
|
||||
|
||||
if (mailEditor)
|
||||
mailEditor->PasteAsQuotation(clipboard);
|
||||
|
@ -87,6 +87,7 @@ _TEST_FILES = \
|
||||
test_bug668599.html \
|
||||
test_bug674770-1.html \
|
||||
file_bug674770-1.html \
|
||||
test_bug674770-2.html \
|
||||
test_bug674861.html \
|
||||
test_bug676401.html \
|
||||
test_bug677752.html \
|
||||
@ -99,11 +100,6 @@ _TEST_FILES = \
|
||||
test_root_element_replacement.html \
|
||||
$(NULL)
|
||||
|
||||
ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
|
||||
_TEST_FILES += test_bug674770-2.html \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
ifneq (mobile,$(MOZ_BUILD_APP))
|
||||
_TEST_FILES += test_spellcheck_pref.html \
|
||||
$(NULL)
|
||||
|
@ -64,9 +64,9 @@ SimpleTest.waitForFocus(function() {
|
||||
|
||||
SimpleTest.executeSoon(function() {
|
||||
synthesizeKey("a", { accelKey: true }, frameWindow);
|
||||
// Windows doesn't have primary selection, we should copy the text to the
|
||||
// global clipboard.
|
||||
if (navigator.platform.indexOf("Win") == 0) {
|
||||
// Windows and Mac don't have primary selection, we should copy the text to
|
||||
// the global clipboard.
|
||||
if (!SpecialPowers.supportsSelectionClipboard()) {
|
||||
SimpleTest.waitForClipboard("pasted",
|
||||
function() { synthesizeKey("c", { accelKey: true }, frameWindow); },
|
||||
function() { SimpleTest.executeSoon(runInputTests1) },
|
||||
|
@ -687,6 +687,14 @@ SpecialPowersAPI.prototype = {
|
||||
cbHelperSvc.copyString(preExpectedVal);
|
||||
},
|
||||
|
||||
supportsSelectionClipboard: function() {
|
||||
if (this._cb == null) {
|
||||
this._cb = Components.classes["@mozilla.org/widget/clipboard;1"].
|
||||
getService(Components.interfaces.nsIClipboard);
|
||||
}
|
||||
return this._cb.supportsSelectionClipboard();
|
||||
},
|
||||
|
||||
snapshotWindow: function (win, withCaret) {
|
||||
var el = this.window.document.createElementNS("http://www.w3.org/1999/xhtml", "canvas");
|
||||
el.width = win.innerWidth;
|
||||
|
Loading…
Reference in New Issue
Block a user