Index: Source/core/editing/EditorCommand.cpp |
diff --git a/Source/core/editing/EditorCommand.cpp b/Source/core/editing/EditorCommand.cpp |
index c2ddb806a47e74a84b24686260100019d34f86ef..e2f664ea2efd3b0f673dfcff1c8888838f5c74b8 100644 |
--- a/Source/core/editing/EditorCommand.cpp |
+++ b/Source/core/editing/EditorCommand.cpp |
@@ -1174,20 +1174,14 @@ static bool supportedCopyCut(LocalFrame* frame) |
{ |
if (!frame) |
return false; |
- |
- Settings* settings = frame->settings(); |
- bool defaultValue = (settings && settings->javaScriptCanAccessClipboard()) || UserGestureIndicator::processingUserGesture(); |
- return frame->editor().client().canCopyCut(frame, defaultValue); |
+ return true; |
} |
static bool supportedPaste(LocalFrame* frame) |
{ |
if (!frame) |
return false; |
- |
- Settings* settings = frame->settings(); |
- bool defaultValue = settings && settings->javaScriptCanAccessClipboard() && settings->DOMPasteAllowed(); |
- return frame->editor().client().canPaste(frame, defaultValue); |
+ return true; |
} |
// Enabled functions |
@@ -1232,12 +1226,16 @@ static bool enableCaretInEditableText(LocalFrame& frame, Event* event, EditorCom |
static bool enabledCopy(LocalFrame& frame, Event*, EditorCommandSource) |
{ |
- return frame.editor().canDHTMLCopy() || frame.editor().canCopy(); |
+ Settings* settings = frame.settings(); |
+ bool defaultValue = (settings && settings->javaScriptCanAccessClipboard()) || UserGestureIndicator::processingUserGesture(); |
+ return frame.editor().client().canCopyCut(&frame, defaultValue) && (frame.editor().canDHTMLCopy() || frame.editor().canCopy()); |
} |
static bool enabledCut(LocalFrame& frame, Event*, EditorCommandSource) |
{ |
- return frame.editor().canDHTMLCut() || frame.editor().canCut(); |
+ Settings* settings = frame.settings(); |
+ bool defaultValue = (settings && settings->javaScriptCanAccessClipboard()) || UserGestureIndicator::processingUserGesture(); |
+ return frame.editor().client().canCopyCut(&frame, defaultValue) && (frame.editor().canDHTMLCut() || frame.editor().canCut()); |
} |
static bool enabledInEditableText(LocalFrame& frame, Event* event, EditorCommandSource) |
@@ -1272,7 +1270,9 @@ static bool enabledInRichlyEditableText(LocalFrame& frame, Event*, EditorCommand |
static bool enabledPaste(LocalFrame& frame, Event*, EditorCommandSource) |
{ |
- return frame.editor().canPaste(); |
+ Settings* settings = frame.settings(); |
+ bool defaultValue = settings && settings->javaScriptCanAccessClipboard() && settings->DOMPasteAllowed(); |
+ return frame.editor().client().canPaste(&frame, defaultValue) && frame.editor().canPaste(); |
} |
static bool enabledRangeInEditableText(LocalFrame& frame, Event*, EditorCommandSource) |