Bug 87749

Summary: [WK2][Qt] Color chooser API missing
Product: WebKit Reporter: Thiago Marcos P. Santos <tmpsantos>
Component: WebKit QtAssignee: Thiago Marcos P. Santos <tmpsantos>
Status: RESOLVED FIXED    
Severity: Normal CC: cmarcelo, dinu.jacob, hausmann, kenneth, menard, vestbo, webkit.review.bot, zoltan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 87495    
Bug Blocks: 87988, 87989, 88101    
Attachments:
Description Flags
Patch
none
Patch
none
Patch v2
none
Patch none

Description Thiago Marcos P. Santos 2012-05-29 08:32:59 PDT
Show a nice color chooser window for <input type="color">.
Comment 1 Thiago Marcos P. Santos 2012-05-31 12:58:57 PDT
Created attachment 145138 [details]
Patch
Comment 2 Kenneth Rohde Christiansen 2012-06-01 03:03:08 PDT
Looks OK to me, but cc'ing Tor Arne to look at the QML related code.
Comment 3 Pierre Rossi 2012-06-08 10:36:44 PDT
Comment on attachment 145138 [details]
Patch

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

Nice stuff, thanks !

> Source/WebKit2/Target.pri:801
> +contains(DEFINES, ENABLE_INPUT_TYPE_COLOR=1) {

Maybe we could enable it by default for Qt 5 in Tools/qmake/mkspecs/features/features.prf ?

> Source/WebKit2/UIProcess/qt/WebColorChooserProxyQt.cpp:36
> +    Q_PROPERTY(QColor currentColor READ currentColor CONSTANT FINAL)

Maybe we'd want to expose the elementRect like in WebPopupMenuProxyQt.
Comment 4 Thiago Marcos P. Santos 2012-06-08 12:39:04 PDT
(In reply to comment #3)
> (From update of attachment 145138 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=145138&action=review
> 
> Nice stuff, thanks !

Thank you very much for having a look.

> 
> > Source/WebKit2/Target.pri:801
> > +contains(DEFINES, ENABLE_INPUT_TYPE_COLOR=1) {
> 
> Maybe we could enable it by default for Qt 5 in Tools/qmake/mkspecs/features/features.prf ?

Good idea. Gonna ask on the qt webkit list when I get this landed if it is fine to enable by default since IMO, the feature is complete.

> 
> > Source/WebKit2/UIProcess/qt/WebColorChooserProxyQt.cpp:36
> > +    Q_PROPERTY(QColor currentColor READ currentColor CONSTANT FINAL)
> 
> Maybe we'd want to expose the elementRect like in WebPopupMenuProxyQt.

The problem here is, unlike PopupMenu, WebCore doesn't provide the coordinates. :/
Comment 5 Thiago Marcos P. Santos 2012-06-13 04:13:51 PDT
Created attachment 147286 [details]
Patch

Rebased.
Comment 6 Kenneth Rohde Christiansen 2012-06-13 04:36:54 PDT
Comment on attachment 147286 [details]
Patch

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

Can we have a tesT?

> Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp:1158
> +    if (d->colorChooser == colorChooser)
> +        return;

we normally add newline after return
Comment 7 Thiago Marcos P. Santos 2012-06-13 05:32:34 PDT
(In reply to comment #6)
> (From update of attachment 147286 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=147286&action=review
> 
> Can we have a tesT?

You do have one. Check bug 88101. :)

> 
> > Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp:1158
> > +    if (d->colorChooser == colorChooser)
> > +        return;
> 
> we normally add newline after return

Gonna fix it.

Thanks for reviewing.
Comment 8 Thiago Marcos P. Santos 2012-06-13 05:45:52 PDT
Created attachment 147302 [details]
Patch v2
Comment 9 Thiago Marcos P. Santos 2012-06-14 03:40:18 PDT
Created attachment 147547 [details]
Patch

Rebased.
Comment 10 WebKit Review Bot 2012-06-21 03:59:10 PDT
Comment on attachment 147547 [details]
Patch

Clearing flags on attachment: 147547

Committed r120915: <http://trac.webkit.org/changeset/120915>
Comment 11 WebKit Review Bot 2012-06-21 03:59:16 PDT
All reviewed patches have been landed.  Closing bug.