RESOLVED FIXED 52785
execCommand("Paste") doesn't work in WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=52785
Summary execCommand("Paste") doesn't work in WebKitTestRunner
Maciej Stachowiak
Reported 2011-01-19 23:06:12 PST
execCommand("Paste") doesn't work in WebKitTestRunner One obvious aspect is the special preference setting for this, but even with that enabled, execCommand("Paste") doesn't seem to work.
Attachments
Patch (14.50 KB, patch)
2011-01-27 15:42 PST, Maciej Stachowiak
darin: review+
Alexey Proskuryakov
Comment 1 2011-01-20 10:38:00 PST
For whatever reason, two preferences need to be set in order for DOM paste to work. I'm told that "Allow Automated Pasting" in Safari debug menu is already broken in WebKit1 because of this, perhaps WebKitTestRunner has the same issue?
Ryosuke Niwa
Comment 2 2011-01-20 13:32:41 PST
Both javaScriptCanAccessClipboard and isDOMPasteAllowed must return true for paste to work: static bool supportedPaste(Frame* frame) { Settings* settings = frame ? frame->settings() : 0; return settings && (settings->javaScriptCanAccessClipboard() ? settings->isDOMPasteAllowed() : 0); }
Ryosuke Niwa
Comment 3 2011-01-20 13:35:51 PST
(In reply to comment #1) > For whatever reason, two preferences need to be set in order for DOM paste to work. I'm told that "Allow Automated Pasting" in Safari debug menu is already broken in WebKit1 because of this, perhaps WebKitTestRunner has the same issue? These two preferences are really obscured. I'd really like to unsupport these two settings and add SecurityOrigin methods (see: https://bugs.webkit.org/show_bug.cgi?id=52417).
Maciej Stachowiak
Comment 4 2011-01-27 15:42:28 PST
Darin Adler
Comment 5 2011-01-27 15:47:40 PST
Comment on attachment 80370 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=80370&action=review > Source/WebKit2/Shared/WebPreferencesStore.h:69 > macro(AuthorAndUserStylesEnabled, authorAndUserStylesEnabled, Bool, bool, true) \ > macro(PaginateDuringLayoutEnabled, paginateDuringLayoutEnabled, Bool, bool, false) \ > macro(DOMPasteAllowed, domPasteAllowed, Bool, bool, false) \ > + macro(JavaScriptCanAccessClipboard, javaScriptCanAccessClipboard, Bool, bool, false) \ > macro(ShouldPrintBackgrounds, shouldPrintBackgrounds, Bool, bool, false) \ Can we keep this sorted alphabetically? > Source/WebKit2/WebProcess/WebPage/WebPage.cpp:1268 > settings->setAuthorAndUserStylesEnabled(store.getBoolValueForKey(WebPreferencesKey::authorAndUserStylesEnabledKey())); > settings->setPaginateDuringLayoutEnabled(store.getBoolValueForKey(WebPreferencesKey::paginateDuringLayoutEnabledKey())); > settings->setDOMPasteAllowed(store.getBoolValueForKey(WebPreferencesKey::domPasteAllowedKey())); > + settings->setJavaScriptCanAccessClipboard(store.getBoolValueForKey(WebPreferencesKey::javaScriptCanAccessClipboardKey())); > settings->setShouldPrintBackgrounds(store.getBoolValueForKey(WebPreferencesKey::shouldPrintBackgroundsKey())); Can we keep this sorted alphabetically?
Maciej Stachowiak
Comment 6 2011-01-27 19:10:14 PST
Maciej Stachowiak
Comment 7 2011-01-27 23:45:25 PST
(In reply to comment #5) > (From update of attachment 80370 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=80370&action=review > > > Source/WebKit2/Shared/WebPreferencesStore.h:69 > > macro(AuthorAndUserStylesEnabled, authorAndUserStylesEnabled, Bool, bool, true) \ > > macro(PaginateDuringLayoutEnabled, paginateDuringLayoutEnabled, Bool, bool, false) \ > > macro(DOMPasteAllowed, domPasteAllowed, Bool, bool, false) \ > > + macro(JavaScriptCanAccessClipboard, javaScriptCanAccessClipboard, Bool, bool, false) \ > > macro(ShouldPrintBackgrounds, shouldPrintBackgrounds, Bool, bool, false) \ > > Can we keep this sorted alphabetically? > > > Source/WebKit2/WebProcess/WebPage/WebPage.cpp:1268 > > settings->setAuthorAndUserStylesEnabled(store.getBoolValueForKey(WebPreferencesKey::authorAndUserStylesEnabledKey())); > > settings->setPaginateDuringLayoutEnabled(store.getBoolValueForKey(WebPreferencesKey::paginateDuringLayoutEnabledKey())); > > settings->setDOMPasteAllowed(store.getBoolValueForKey(WebPreferencesKey::domPasteAllowedKey())); > > + settings->setJavaScriptCanAccessClipboard(store.getBoolValueForKey(WebPreferencesKey::javaScriptCanAccessClipboardKey())); > > settings->setShouldPrintBackgrounds(store.getBoolValueForKey(WebPreferencesKey::shouldPrintBackgroundsKey())); > > Can we keep this sorted alphabetically? I ended up not sorting because I didn't want to inject an unrelated change, but yes, I believe this can be sorted as an independent cleanup.
Note You need to log in before you can comment on or make changes to this bug.