Implement unprivileged execCommand("copy") and execCommand("cut")
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Mar 2016 04:43:58 +0000 (04:43 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Mar 2016 04:43:58 +0000 (04:43 +0000)
commit8ceae9d9af6772babf87be4842d8029552f29392
tree7ff383a83a05b78da842f5c8dec2ea37ba44da57
parentba3e6a208e170f0a85cb976d3f239f2738094287
Implement unprivileged execCommand("copy") and execCommand("cut")
<rdar://problem/24354406>
https://bugs.webkit.org/show_bug.cgi?id=146336

Reviewed by Dean Jackson.

Source/WebCore:

Test: editing/execCommand/clipboard-access-with-user-gesture.html

* WebCore.xcodeproj/project.pbxproj:
Add new files.

* editing/ClipboardAccessPolicy.h:
Added.

* editing/EditorCommand.cpp:
(WebCore::defaultValueForSupportedCopyCut):
(WebCore::supportedCopyCut):
Match other browsers and allow the copy and cut commands
to be executed when there is a user gesture.

* page/Settings.h:
Add include of ClipboardAccessPolicy.h.

* page/Settings.in:
Add new setting for ClipboardAccessPolicy

LayoutTests:

* editing/execCommand/clipboard-access-with-user-gesture-expected.txt: Added.
* editing/execCommand/clipboard-access-with-user-gesture.html: Added.
Add test for using execCommand("copy") and execCommand("cut") during a user gesture.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198092 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/execCommand/clipboard-access-with-user-gesture-expected.txt [new file with mode: 0644]
LayoutTests/editing/execCommand/clipboard-access-with-user-gesture.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/editing/ClipboardAccessPolicy.h [new file with mode: 0644]
Source/WebCore/editing/EditorCommand.cpp
Source/WebCore/page/Settings.h
Source/WebCore/page/Settings.in