Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(376)

Unified Diff: Source/core/editing/EditorCommand.cpp

Issue 1097693003: queryCommandSupported() should return 'true' for cut/copy/paste editing commands (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/editing/execCommand/cut-copy-paste-support-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « LayoutTests/editing/execCommand/cut-copy-paste-support-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698