Bug 119120

Summary: [EFL][WK2] Move and make WKColorPickerResultListener to EFL specific interface
Product: WebKit Reporter: Ryuan Choi <ryuan.choi>
Component: WebKit EFLAssignee: Ryuan Choi <ryuan.choi>
Status: RESOLVED FIXED    
Severity: Normal CC: abecsi, buildbot, bunhere, cdumez, cmarcelo, commit-queue, gyuyoung.kim, gyuyoung.kim, lucas.de.marchi, menard, mikhail.pozdnyakov, mpakulavelrutka, rakuco, rego+ews, rniwa, ruthiecftg, santosh.ma, sergio, xan.lopez
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 126960    
Attachments:
Description Flags
Patch
none
Patch
none
another suggestion
none
another suggestion
none
another suggestion
none
another suggestion
none
another suggestion
none
rebased
none
rebased
none
rebased
none
Patch none

Description Ryuan Choi 2013-07-25 19:30:20 PDT
As 61276 and 119030 addressed, WK2 ports implement color picker as two way.
1. inherit WebColorPicker
2. register PageUIClient Callback

Only EFL port implements it as second way.
Second way might be good for some ports to expose UIClient as WK API.
But I think that it just make confusion.

I will refactor EFL port to use first way.
Comment 1 Ryuan Choi 2013-07-25 19:39:45 PDT
Created attachment 207502 [details]
Patch
Comment 2 Ryuan Choi 2013-07-31 18:35:31 PDT
Created attachment 207892 [details]
Patch
Comment 3 Gyuyoung Kim 2013-07-31 19:03:10 PDT
(In reply to comment #0)
> As 61276 and 119030 addressed, WK2 ports implement color picker as two way.
> 1. inherit WebColorPicker
> 2. register PageUIClient Callback
> 
> Only EFL port implements it as second way.
> Second way might be good for some ports to expose UIClient as WK API.
> But I think that it just make confusion.
> 
> I will refactor EFL port to use first way.

As far as I know, we have tried to use C API instead of inheriting WK2 internal class. This may violate a layer rule on EFL ewk implementation. Why not we use second way ?
Comment 4 Chris Dumez 2013-07-31 22:40:49 PDT
Comment on attachment 207892 [details]
Patch

We are using the C API on purpose. Using internal wk2 types from our API layer is a layering violation. Therefore, I believe this patch is a step in the wrong direction.
Comment 5 Ryuan Choi 2013-08-05 01:28:16 PDT
Created attachment 208110 [details]
another suggestion
Comment 6 Ryuan Choi 2013-08-05 01:34:33 PDT
(In reply to comment #4)
> (From update of attachment 207892 [details])
> We are using the C API on purpose. Using internal wk2 types from our API layer is a layering violation. Therefore, I believe this patch is a step in the wrong direction.

OK, but previous logic looks confusing because there were two paths in WebPageProxy and m_uiClient.showColorPicker was only for EFL (at least now)

Instead, I added Efl specific WK API to isolate color picker callbacks only for EFL.
Comment 7 Early Warning System Bot 2013-08-05 01:39:53 PDT
Comment on attachment 208110 [details]
another suggestion

Attachment 208110 [details] did not pass qt-wk2-ews (qt-wk2):
Output: http://webkit-queues.appspot.com/results/1357023
Comment 8 Build Bot 2013-08-05 01:53:40 PDT
Comment on attachment 208110 [details]
another suggestion

Attachment 208110 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/1377054
Comment 9 Build Bot 2013-08-05 02:07:38 PDT
Comment on attachment 208110 [details]
another suggestion

Attachment 208110 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/1378051
Comment 10 Ryuan Choi 2013-08-05 02:39:32 PDT
Created attachment 208113 [details]
another suggestion
Comment 11 Early Warning System Bot 2013-08-05 02:45:39 PDT
Comment on attachment 208113 [details]
another suggestion

Attachment 208113 [details] did not pass qt-wk2-ews (qt-wk2):
Output: http://webkit-queues.appspot.com/results/1380071
Comment 12 Ryuan Choi 2013-08-05 02:57:51 PDT
Created attachment 208114 [details]
another suggestion
Comment 13 Early Warning System Bot 2013-08-05 03:04:23 PDT
Comment on attachment 208114 [details]
another suggestion

Attachment 208114 [details] did not pass qt-wk2-ews (qt-wk2):
Output: http://webkit-queues.appspot.com/results/1375063
Comment 14 Ryuan Choi 2013-08-05 03:15:24 PDT
Created attachment 208115 [details]
another suggestion
Comment 15 Build Bot 2013-08-05 03:40:17 PDT
Comment on attachment 208115 [details]
another suggestion

Attachment 208115 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/1376096
Comment 16 Gyuyoung Kim 2013-08-05 03:44:52 PDT
Comment on attachment 208114 [details]
another suggestion

View in context: https://bugs.webkit.org/attachment.cgi?id=208114&action=review

r- because qt-wk2 ews is failed.

> Source/WebKit2/ChangeLog:3
> +        [EFL][WK2] Refactor color picker implementation

I'm not sure if we can use [EFL] prefix in title. Because this patch influences on QT and GTK ports. How about changing with "[WK2] Refactor color picker implementation for EFL port." ? It looks you need to get approval of WK2 owner.

> Source/WebKit2/ChangeLog:12
> +        So, this patch introduce WKColorPickerClient which is new WK interface

introduces ?
Comment 17 Ryuan Choi 2013-08-05 03:50:43 PDT
Created attachment 208116 [details]
another suggestion
Comment 18 Ryuan Choi 2013-08-05 04:04:12 PDT
(In reply to comment #16)
> (From update of attachment 208114 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=208114&action=review
> 
> r- because qt-wk2 ews is failed.
> 

Sorry for noise, I hope that last patch be fine for all wk2 bot.

> > Source/WebKit2/ChangeLog:3
> > +        [EFL][WK2] Refactor color picker implementation
> 
> I'm not sure if we can use [EFL] prefix in title. Because this patch influences on QT and GTK ports. How about changing with "[WK2] Refactor color picker implementation for EFL port." ? It looks you need to get approval of WK2 owner.
> 

I agree with you, so I wanted to separate patches about it because I think that this is for EFL.

If this approach is acceptable, I can move ColorPickerResultListener related files in another bug before landing this.
Or just removing "[EFL]" is acceptable, I will do it.

> > Source/WebKit2/ChangeLog:12
> > +        So, this patch introduce WKColorPickerClient which is new WK interface
> 
> introduces ?

OK, I will fix it in next patch.
Comment 19 Chris Dumez 2013-08-09 03:22:20 PDT
Comment on attachment 208116 [details]
another suggestion

View in context: https://bugs.webkit.org/attachment.cgi?id=208116&action=review

It is really not clear to me why this patch improves the current situation and the Changelog does not clarify things. It seems this patch mostly move generic WK2 code and makes it EFL-specific (thus preventing other ports from using it).

> Source/WebKit2/ChangeLog:8
> +        Since r153541, WK2 port removed a way to register PageUIClient Callbacks,

I don't understand this sentence.

> Source/WebKit2/ChangeLog:19
> +        * UIProcess/API/C/efl/WKColorPickerResultListener.cpp: Renamed from Source/WebKit2/UIProcess/API/C/WKColorPickerResultListener.cpp.

I'm not sure we want to move this one to efl/. iirc, the file was put there in the first place because other ports showed interest in using  it as well.
Comment 20 Santosh Mahto 2013-08-23 06:23:00 PDT
Hi ryuan

Crash is happening while clicking to launch color picker.
It looks to me efl need your colorful this patch.
Comment 21 Gyuyoung Kim 2013-12-25 21:04:27 PST
Any update ?
Comment 22 Ryuan Choi 2014-01-01 20:51:14 PST
Comment on attachment 208116 [details]
another suggestion

Clearing flags. At least, this patch should be rebased.
Comment 23 Ryuan Choi 2014-02-04 21:19:29 PST
Created attachment 223207 [details]
rebased
Comment 24 Ryuan Choi 2014-02-04 21:27:04 PST
(In reply to comment #19)
> (From update of attachment 208116 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=208116&action=review
> 
> It is really not clear to me why this patch improves the current situation and the Changelog does not clarify things. It seems this patch mostly move generic WK2 code and makes it EFL-specific (thus preventing other ports from using it).
> 
> > Source/WebKit2/ChangeLog:8
> > +        Since r153541, WK2 port removed a way to register PageUIClient Callbacks,
> 
> I don't understand this sentence.
> 
> > Source/WebKit2/ChangeLog:19
> > +        * UIProcess/API/C/efl/WKColorPickerResultListener.cpp: Renamed from Source/WebKit2/UIProcess/API/C/WKColorPickerResultListener.cpp.
> 
> I'm not sure we want to move this one to efl/. iirc, the file was put there in the first place because other ports showed interest in using  it as well.

I updated bug title and change log little bit.

Since I made this patch, EFL port has a crash when accessed color input.
I don't know who want to use WKColorPickerResultListener but I believe that EFL port will only use it until new port are appeared.

So, I want to move them out of the common code until someone raise their needs once more.
Comment 25 Jinwoo Song 2014-02-04 21:42:12 PST
Comment on attachment 223207 [details]
rebased

View in context: https://bugs.webkit.org/attachment.cgi?id=223207&action=review

> Source/WebKit2/UIProcess/efl/ViewClientEfl.h:56
> +#if ENABLE(TOUCH_EVENTS)

INPUT_TYPE_COLOR?
Comment 26 Ryuan Choi 2014-02-04 21:45:46 PST
Comment on attachment 223207 [details]
rebased

View in context: https://bugs.webkit.org/attachment.cgi?id=223207&action=review

>> Source/WebKit2/UIProcess/efl/ViewClientEfl.h:56
>> +#if ENABLE(TOUCH_EVENTS)
> 
> INPUT_TYPE_COLOR?

Unbelievable. I will fix it.

Thank you so much.
Comment 27 Ryuan Choi 2014-02-04 21:48:26 PST
Created attachment 223209 [details]
rebased
Comment 28 Ryuan Choi 2014-02-04 21:50:27 PST
Created attachment 223210 [details]
rebased
Comment 29 Gyuyoung Kim 2014-02-17 16:14:08 PST
Comment on attachment 223210 [details]
rebased

View in context: https://bugs.webkit.org/attachment.cgi?id=223210&action=review

> Source/WebKit2/ChangeLog:9
> +        Indeed, it does not work since refactored common logic for ColorPicker in WebPageProxy.

Are you sure if Mac or GTK won't use this logic in future ?

> Source/WebKit2/UIProcess/efl/ViewClientEfl.cpp:199
> +#if ENABLE(INPUT_TYPE_COLOR)

Why can't we initialize colorPickerClient when color picker needs to be shown ?

> Source/WebKit2/UIProcess/efl/WebColorPickerEfl.h:48
> +    void didChooseColor(const WebCore::Color&);

Add a new line.
Comment 30 Ryuan Choi 2014-02-17 17:54:03 PST
Comment on attachment 223210 [details]
rebased

View in context: https://bugs.webkit.org/attachment.cgi?id=223210&action=review

>> Source/WebKit2/ChangeLog:9
>> +        Indeed, it does not work since refactored common logic for ColorPicker in WebPageProxy.
> 
> Are you sure if Mac or GTK won't use this logic in future ?

Absolutely.
Mac implemented color picker using another way and GTK port does not use WK interface(And GTK also use color picker like Mac port, IIRC)
They don't need to use interface because they can implement picker in the platform.

But in EFL side, we can't implement complex UI components in ewebkit because we don't use elm.

>> Source/WebKit2/UIProcess/efl/ViewClientEfl.cpp:199
>> +#if ENABLE(INPUT_TYPE_COLOR)
> 
> Why can't we initialize colorPickerClient when color picker needs to be shown ?

It is to receive callback which notify when color picker needs to be shown.

>> Source/WebKit2/UIProcess/efl/WebColorPickerEfl.h:48
>> +    void didChooseColor(const WebCore::Color&);
> 
> Add a new line.

OK, I will add it.
Comment 31 Ryuan Choi 2014-02-17 19:22:05 PST
Created attachment 224459 [details]
Patch
Comment 32 Gyuyoung Kim 2014-02-17 20:54:21 PST
Comment on attachment 224459 [details]
Patch

This patch was created a very long time ago. I think now is time to move this to EFL specific place. However, if any port will want to use this concept in future, we need to roll this change back. Looks fine for now.
Comment 33 Ryuan Choi 2014-02-17 21:08:11 PST
Comment on attachment 224459 [details]
Patch

Clearing flags on attachment: 224459

Committed r164271: <http://trac.webkit.org/changeset/164271>
Comment 34 Ryuan Choi 2014-02-17 21:08:21 PST
All reviewed patches have been landed.  Closing bug.
Comment 35 Michal Pakula vel Rutka 2014-02-18 05:32:48 PST
*** Bug 126067 has been marked as a duplicate of this bug. ***