RESOLVED FIXED213568
Allow the async clipboard API to write data when copying via menu action or key binding
https://bugs.webkit.org/show_bug.cgi?id=213568
Summary Allow the async clipboard API to write data when copying via menu action or k...
Wenson Hsieh
Reported 2020-06-24 11:25:30 PDT
SSIA
Attachments
Patch (12.45 KB, patch)
2020-06-24 14:02 PDT, Wenson Hsieh
no flags
Radar WebKit Bug Importer
Comment 1 2020-06-24 11:31:30 PDT
Wenson Hsieh
Comment 2 2020-06-24 14:02:54 PDT
Darin Adler
Comment 3 2020-06-24 14:10:07 PDT
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?
Wenson Hsieh
Comment 4 2020-06-24 14:35:49 PDT
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.
EWS
Comment 5 2020-06-24 16:00:27 PDT
Committed r263480: <https://trac.webkit.org/changeset/263480> All reviewed patches have been landed. Closing bug and clearing flags on attachment 402684 [details].
Darin Adler
Comment 6 2020-06-24 17:14:20 PDT
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.
Wenson Hsieh
Comment 7 2020-06-24 17:17:46 PDT
(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>
Note You need to log in before you can comment on or make changes to this bug.