SSIA
<rdar://problem/64711653>
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>