Bug 119799

Summary: [EFL][WK2] Add pasteboard client to WKContext
Product: WebKit Reporter: Michal Pakula vel Rutka <mpakulavelrutka>
Component: WebKit2Assignee: Michal Pakula vel Rutka <mpakulavelrutka>
Status: RESOLVED WONTFIX    
Severity: Normal CC: abecsi, buildbot, bunhere, cdumez, cmarcelo, commit-queue, darin, eflews.bot, gyuyoung.kim, mcatanzaro, menard, rakuco, rniwa, sam, sergio
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 102484    
Attachments:
Description Flags
patch
eflews.bot: commit-queue-
add missing files
none
fixed style
sam: review-, buildbot: commit-queue-
new patch
none
fixes after review gyuyoung.kim: review-

Michal Pakula vel Rutka
Reported 2013-08-14 08:13:54 PDT
Add pasteboard client to WKContext for ports that want to handle copy and paste operations in UIProcess.
Attachments
patch (11.84 KB, patch)
2013-08-14 08:17 PDT, Michal Pakula vel Rutka
eflews.bot: commit-queue-
add missing files (16.41 KB, patch)
2013-08-14 08:24 PDT, Michal Pakula vel Rutka
no flags
fixed style (16.40 KB, patch)
2013-08-14 08:32 PDT, Michal Pakula vel Rutka
sam: review-
buildbot: commit-queue-
new patch (20.82 KB, patch)
2014-06-12 03:09 PDT, Michal Pakula vel Rutka
no flags
fixes after review (20.76 KB, patch)
2014-07-21 07:07 PDT, Michal Pakula vel Rutka
gyuyoung.kim: review-
Michal Pakula vel Rutka
Comment 1 2013-08-14 08:17:39 PDT
WebKit Commit Bot
Comment 2 2013-08-14 08:19:45 PDT
Attachment 208727 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit2/CMakeLists.txt', u'Source/WebKit2/ChangeLog', u'Source/WebKit2/GNUmakefile.list.am', u'Source/WebKit2/Target.pri', u'Source/WebKit2/UIProcess/API/C/WKContext.cpp', u'Source/WebKit2/UIProcess/API/C/WKContext.h', u'Source/WebKit2/UIProcess/WebContext.cpp', u'Source/WebKit2/UIProcess/WebContext.h', u'Source/WebKit2/WebKit2.xcodeproj/project.pbxproj']" exit_code: 1 Source/WebKit2/UIProcess/WebContext.h:45: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 1 in 9 files If any of these errors are false positives, please file a bug against check-webkit-style.
EFL EWS Bot
Comment 3 2013-08-14 08:21:13 PDT
Michal Pakula vel Rutka
Comment 4 2013-08-14 08:24:52 PDT
Created attachment 208728 [details] add missing files
WebKit Commit Bot
Comment 5 2013-08-14 08:26:54 PDT
Attachment 208728 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit2/CMakeLists.txt', u'Source/WebKit2/ChangeLog', u'Source/WebKit2/GNUmakefile.list.am', u'Source/WebKit2/Target.pri', u'Source/WebKit2/UIProcess/API/C/WKContext.cpp', u'Source/WebKit2/UIProcess/API/C/WKContext.h', u'Source/WebKit2/UIProcess/WebContext.cpp', u'Source/WebKit2/UIProcess/WebContext.h', u'Source/WebKit2/UIProcess/WebPasteboardClient.cpp', u'Source/WebKit2/UIProcess/WebPasteboardClient.h', u'Source/WebKit2/WebKit2.xcodeproj/project.pbxproj']" exit_code: 1 Source/WebKit2/UIProcess/WebPasteboardClient.h:40: The parameter name "context" adds no information, so it should be removed. [readability/parameter_name] [5] Source/WebKit2/UIProcess/WebPasteboardClient.h:41: The parameter name "context" adds no information, so it should be removed. [readability/parameter_name] [5] Total errors found: 2 in 11 files If any of these errors are false positives, please file a bug against check-webkit-style.
Michal Pakula vel Rutka
Comment 6 2013-08-14 08:32:46 PDT
Created attachment 208729 [details] fixed style
Build Bot
Comment 7 2013-08-14 08:49:17 PDT
Comment on attachment 208729 [details] fixed style Attachment 208729 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/1451874
Sam Weinig
Comment 8 2013-08-14 11:18:12 PDT
I don't think this should go on the WebContext, it seems like it is better suited at the page level.
Darin Adler
Comment 9 2013-08-15 11:12:49 PDT
(In reply to comment #8) > I don't think this should go on the WebContext, it seems like it is better suited at the page level. Currently many basic pasteboard operations are done in the platform layer where this no concept of page; I’m not sure exactly how the page level exists at the platform layer, although it’s possible there is a platform-level concept that can end up communicating up through the page. iOS is an exception because pasteboard operations have to go through the frame delegate, and it’s an exception I am trying to fix. Sam, could you clarify how you would want to see this work?
Sam Weinig
Comment 10 2013-08-15 13:07:12 PDT
(In reply to comment #9) > (In reply to comment #8) > > I don't think this should go on the WebContext, it seems like it is better suited at the page level. > > Currently many basic pasteboard operations are done in the platform layer where this no concept of page; I’m not sure exactly how the page level exists at the platform layer, although it’s possible there is a platform-level concept that can end up communicating up through the page. > > iOS is an exception because pasteboard operations have to go through the frame delegate, and it’s an exception I am trying to fix. > > Sam, could you clarify how you would want to see this work? Oh right, we do pasteboard through PlatformStrategies. I'm still not sure a client on WebContext makes sense. Really, there should be no client in the UIProcess, and ports should just implement the necessary functions in WebContext, like the Mac port does.
Michal Pakula vel Rutka
Comment 11 2013-08-20 08:10:08 PDT
(In reply to comment #10) > (In reply to comment #9) > > (In reply to comment #8) > > > I don't think this should go on the WebContext, it seems like it is better suited at the page level. > > > > Currently many basic pasteboard operations are done in the platform layer where this no concept of page; I’m not sure exactly how the page level exists at the platform layer, although it’s possible there is a platform-level concept that can end up communicating up through the page. > > > > iOS is an exception because pasteboard operations have to go through the frame delegate, and it’s an exception I am trying to fix. > > > > Sam, could you clarify how you would want to see this work? > > Oh right, we do pasteboard through PlatformStrategies. I'm still not sure a client on WebContext makes sense. Really, there should be no client in the UIProcess, and ports should just implement the necessary functions in WebContext, like the Mac port does. EFL framework's copy and paste API is located in Elementary (http://docs.enlightenment.org/auto/elementary/group__CopyPaste.html) which is a widget toolkit for creating applications containing UI widgets. We cannot include elementary into WebKit because elementary depends on WebKit via elm_web and elm_web2 widgets (a simple webviews). Second thing is that you can use Elementary copy and paste API, only in Elementary application (sample at the bottom https://trac.enlightenment.org/e/wiki/Elementary). Because of the conditions above in EFL port pasteboard cannot be done in WebCore like i.e. in GTK+ or Qt ports or in WebProcess like Mac, but copy and paste has to be delegated to Elementary application and the client in UIProcess is needed for implementation in EFL port. This patch is split from bug 102484 where now the rest of EFL pasteboard implementation is posted. In previous patch I made the WK client EFL-only, while here I made it common as it possibly may be used by Nix port.
Michal Pakula vel Rutka
Comment 12 2014-06-12 03:09:29 PDT
Created attachment 232941 [details] new patch As WebKit Nix was removed from upstream, new version of a patch introduces pasteboard client used only by EFL port.
Gyuyoung Kim
Comment 13 2014-07-21 03:36:28 PDT
Comment on attachment 232941 [details] new patch View in context: https://bugs.webkit.org/attachment.cgi?id=232941&action=review > Source/WebKit2/UIProcess/API/C/efl/WKContextEfl.cpp:43 > +void WKContextSetPasteboardClient(WKContextRef contextRef, const WKContextPasteboardClientBase* wkClient) When/where is this client called ? I mean EFL needs to register own callbacks by using this function. > Source/WebKit2/UIProcess/API/C/efl/WKContextEfl.cpp:62 > + } Need a new line. > Source/WebKit2/UIProcess/API/C/efl/WKContextEfl.cpp:70 > + Unneeded line. > Source/WebKit2/UIProcess/efl/WebContextEfl.cpp:149 > + if (!pasteboardClient) I'm not sure whether we need to check if pasteboardClient is null. I don't see any code which checks if std::unique_ptr argument is null.
Michal Pakula vel Rutka
Comment 14 2014-07-21 06:48:22 PDT
Comment on attachment 232941 [details] new patch View in context: https://bugs.webkit.org/attachment.cgi?id=232941&action=review >> Source/WebKit2/UIProcess/API/C/efl/WKContextEfl.cpp:43 >> +void WKContextSetPasteboardClient(WKContextRef contextRef, const WKContextPasteboardClientBase* wkClient) > > When/where is this client called ? I mean EFL needs to register own callbacks by using this function. The rest of implementation is in bug 120209. WKContextSetPasteboardClient is called when PasteboardClientEfl is created, which happen during constructing Ewk_Context. Callbacks are registered by ewk_context API. >> Source/WebKit2/UIProcess/efl/WebContextEfl.cpp:149 >> + if (!pasteboardClient) > > I'm not sure whether we need to check if pasteboardClient is null. I don't see any code which checks if std::unique_ptr argument is null. Similar code can be found here: https://trac.webkit.org/browser/trunk/Source/WebKit2/UIProcess/WebContext.cpp#L299. The difference is that setPasteboardClient which is called by WKContextSetPasteboardClient will be used internally and null cannot be passed (bug 120209). I will remove this check.
Michal Pakula vel Rutka
Comment 15 2014-07-21 07:07:47 PDT
Created attachment 235218 [details] fixes after review
Gyuyoung Kim
Comment 16 2014-07-22 17:39:48 PDT
Comment on attachment 235218 [details] fixes after review Can we test this feature using unit test or layout test ?
Michal Pakula vel Rutka
Comment 17 2014-07-31 08:26:27 PDT
(In reply to comment #16) > (From update of attachment 235218 [details]) > Can we test this feature using unit test or layout test ? Unit test are added for EWK API in bug 120209, layout test will start to pass after all patches will land.
Gyuyoung Kim
Comment 18 2015-02-03 07:36:22 PST
Michal, I wonder whether EFL port still needs this patch. If so, please rebase this patch against latest trunk.
Gyuyoung Kim
Comment 19 2016-03-09 16:35:12 PST
Comment on attachment 235218 [details] fixes after review r- because this patch needs to be updated against latest trunk.
Michael Catanzaro
Comment 20 2017-03-11 10:45:17 PST
Closing this bug because the EFL port has been removed from trunk. If you feel this bug applies to a different upstream WebKit port and was closed in error, please either update the title and reopen the bug, or leave a comment to request this.
Note You need to log in before you can comment on or make changes to this bug.