| Summary: | Allow the async clipboard API to write data when copying via menu action or key binding | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Wenson Hsieh <wenson_hsieh> | ||||
| Component: | HTML Editing | Assignee: | Wenson Hsieh <wenson_hsieh> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | aestes, bdakin, darin, ews-watchlist, megan_gardner, mifenton, thorton, webkit-bug-importer, wenson_hsieh | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
|
Description
Wenson Hsieh
2020-06-24 11:25:30 PDT
Created attachment 402684 [details]
Patch
Comment on attachment 402684 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=402684&action=review > Source/WebCore/Modules/async-clipboard/Clipboard.cpp:53 > + if (settings.javaScriptCanAccessClipboard() || frame.editor().isCopyingFromMenuOrKeyBinding()) Is it always right to ask this Frame’s editor? Should we instead ask the main frame’s editor? Comment on attachment 402684 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=402684&action=review Thanks for the review! >> Source/WebCore/Modules/async-clipboard/Clipboard.cpp:53 >> + if (settings.javaScriptCanAccessClipboard() || frame.editor().isCopyingFromMenuOrKeyBinding()) > > Is it always right to ask this Frame’s editor? Should we instead ask the main frame’s editor? I believe it's right to ask this Frame's editor, since (in the case of copying from menu/key binding) the information about the editor command source is propagated down to the Frame responsible for handling and dispatching the clipboard event, which might be a subframe instead of the mainframe. Committed r263480: <https://trac.webkit.org/changeset/263480> All reviewed patches have been landed. Closing bug and clearing flags on attachment 402684 [details]. Comment on attachment 402684 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=402684&action=review >>> Source/WebCore/Modules/async-clipboard/Clipboard.cpp:53 >>> + if (settings.javaScriptCanAccessClipboard() || frame.editor().isCopyingFromMenuOrKeyBinding()) >> >> Is it always right to ask this Frame’s editor? Should we instead ask the main frame’s editor? > > I believe it's right to ask this Frame's editor, since (in the case of copying from menu/key binding) the information about the editor command source is propagated down to the Frame responsible for handling and dispatching the clipboard event, which might be a subframe instead of the mainframe. I bet you are right. Probably should add a test to prove it at some point. (In reply to Darin Adler from comment #6) > Comment on attachment 402684 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=402684&action=review > > >>> Source/WebCore/Modules/async-clipboard/Clipboard.cpp:53 > >>> + if (settings.javaScriptCanAccessClipboard() || frame.editor().isCopyingFromMenuOrKeyBinding()) > >> > >> Is it always right to ask this Frame’s editor? Should we instead ask the main frame’s editor? > > > > I believe it's right to ask this Frame's editor, since (in the case of copying from menu/key binding) the information about the editor command source is propagated down to the Frame responsible for handling and dispatching the clipboard event, which might be a subframe instead of the mainframe. > > I bet you are right. Probably should add a test to prove it at some point. Will do! <https://webkit.org/b/213581> |