Bug 87495

Summary: [WK2] Color chooser API missing
Product: WebKit Reporter: Thiago Marcos P. Santos <tmpsantos>
Component: WebKit2Assignee: Thiago Marcos P. Santos <tmpsantos>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, cgarcia, cmarcelo, dinu.jacob, gustavo, hausmann, kenneth, menard, mrobinson, noam, pierre.rossi, rakuco, sam, vestbo, webkit.review.bot, zoltan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 87496, 87749, 87989    
Attachments:
Description Flags
Patch
none
Patch v2
none
Patch
none
Patch v4
none
Patch v5
none
Patch none

Description Thiago Marcos P. Santos 2012-05-25 06:04:36 PDT
This is API allows the embedder to display a custom color chooser for <input type="color">.
Comment 1 Pierre Rossi 2012-05-29 08:23:48 PDT
*** Bug 87496 has been marked as a duplicate of this bug. ***
Comment 2 Thiago Marcos P. Santos 2012-05-31 12:48:08 PDT
Created attachment 145137 [details]
Patch
Comment 3 Alexis Menard (darktears) 2012-06-04 05:40:42 PDT
(In reply to comment #2)
> Created an attachment (id=145137) [details]
> Patch

You don't have Xcode to add the files for mac?
Comment 4 Thiago Marcos P. Santos 2012-06-04 05:50:52 PDT
(In reply to comment #3)
> (In reply to comment #2)
> > Created an attachment (id=145137) [details] [details]
> > Patch
> 
> You don't have Xcode to add the files for mac?

Unfortunately I don't.
Comment 5 Thiago Marcos P. Santos 2012-06-05 03:58:10 PDT
Created attachment 145752 [details]
Patch v2

Thanks Alexis for adding the files to xcode buildsystem.
Comment 6 Thiago Marcos P. Santos 2012-06-13 04:11:33 PDT
Created attachment 147284 [details]
Patch

Rebased.
Comment 7 Anders Carlsson 2012-06-13 09:12:21 PDT
Comment on attachment 147284 [details]
Patch

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

According to http://www.webkit.org/coding/contributing.html, new files should have the WebKit license and not LGPL. Patch looks good otherwise.

> Source/WebKit2/UIProcess/PageClient.h:176
> +    virtual PassRefPtr<WebColorChooserProxy> createColorChooserProxy(WebPageProxy*, const WebCore::Color&) = 0;

I think it's good to name this parameter initialColor.

> Source/WebKit2/UIProcess/WebPageProxy.h:794
> +    void showColorChooser(const WebCore::Color&);

I think it's good to name this parameter initialColor.

> Source/WebKit2/WebKit2.xcodeproj/project.pbxproj:891
> +		E131CFA8157D1C9A002A66B3 /* WebColorChooser.cpp in CopyFiles */ = {isa = PBXBuildFile; fileRef = E131CFA6157D1C9A002A66B3 /* WebColorChooser.cpp */; };
> +		E131CFA9157D1C9A002A66B3 /* WebColorChooser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E131CFA6157D1C9A002A66B3 /* WebColorChooser.cpp */; };
> +		E131CFAA157D1C9A002A66B3 /* WebColorChooser.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = E131CFA7157D1C9A002A66B3 /* WebColorChooser.h */; };
> +		E131CFAD157D1CD7002A66B3 /* WebColorChooserProxy.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = E131CFAC157D1CD7002A66B3 /* WebColorChooserProxy.h */; };

This part is incorrect. You have to add the files using Xcode and not edit the project file manually.
Comment 8 Thiago Marcos P. Santos 2012-06-13 14:57:01 PDT
Created attachment 147418 [details]
Patch v4

Updated patch fixing what was pointed by the review.
Comment 9 Gyuyoung Kim 2012-06-13 17:21:13 PDT
Comment on attachment 147418 [details]
Patch v4

Attachment 147418 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/12951445
Comment 10 Thiago Marcos P. Santos 2012-06-14 03:37:00 PDT
Created attachment 147546 [details]
Patch v5

Now with stubs for all the ports, so it wont break the build for ports like EFL that has colorpicker enabled for wk1 and are building wk2.
Comment 11 WebKit Review Bot 2012-06-14 03:38:36 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 12 Noam Rosenthal 2012-06-15 06:42:21 PDT
Shouln't a new feature like this include some tests?
Comment 13 Kenneth Rohde Christiansen 2012-06-15 06:46:10 PDT
It did as a separate bug report
Comment 14 Noam Rosenthal 2012-06-15 07:09:19 PDT
(In reply to comment #13)
> It did as a separate bug report

Right, my oversight.
Comment 15 Andreas Kling 2012-06-20 13:02:27 PDT
Comment on attachment 147546 [details]
Patch v5

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

r=me based on Anders's prior assessment and the patch looking generally fine to me.

> Source/WebKit2/WebProcess/WebCoreSupport/WebColorChooser.h:45
> +    ~WebColorChooser();

Should mark this explicitly virtual.
Comment 16 Thiago Marcos P. Santos 2012-06-20 15:09:08 PDT
Created attachment 148663 [details]
Patch
Comment 17 WebKit Review Bot 2012-06-20 17:44:19 PDT
Comment on attachment 148663 [details]
Patch

Clearing flags on attachment: 148663

Committed r120890: <http://trac.webkit.org/changeset/120890>
Comment 18 WebKit Review Bot 2012-06-20 17:44:26 PDT
All reviewed patches have been landed.  Closing bug.