Bug 91645

Summary: [Qt][WK2] Map the elementRect exposed in QML to the view for popup menu
Product: WebKit Reporter: Pierre Rossi <pierre.rossi>
Component: New BugsAssignee: Pierre Rossi <pierre.rossi>
Status: RESOLVED FIXED    
Severity: Normal CC: cmarcelo, hausmann, menard, webkit.review.bot, zoltan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Pierre Rossi 2012-07-18 11:29:58 PDT
[Qt][WK2] Map the elementRect exposed in QML to the view for popup menu
Comment 1 Pierre Rossi 2012-07-18 11:34:27 PDT
Created attachment 153057 [details]
Patch
Comment 2 Simon Hausmann 2012-07-19 02:05:05 PDT
Comment on attachment 153057 [details]
Patch

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

> Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.cpp:102
>      Q_PROPERTY(QObject* items READ items CONSTANT FINAL)
>  
>  public:
> -    ItemSelectorContextObject(const IntRect& elementRect, const Vector<WebPopupItem>&, int selectedIndex);
> +    ItemSelectorContextObject(const QRectF& elementRect, const Vector<WebPopupItem>&, int selectedIndex);
>  
> -    QRect elementRect() const { return m_elementRect; }
> +    QRectF elementRect() const { return m_elementRect; }
>      PopupMenuItemModel* items() { return &m_items; }
>  
> +    Q_INVOKABLE int itemCount() const { return m_items.rowCount(); }

I think there's an API problem here, that's strictly speaking unrelated to your patch.

If "items" is the model, then shouldn't it be called "model" perhaps?

Anyway, I don't think itemCount() should be an invokable method. Instead all models in QML seem to have a "count" _property_ instead, and I think that's what we should have, too.
Comment 3 Pierre Rossi 2012-07-19 06:40:50 PDT
Created attachment 153246 [details]
Patch
Comment 4 WebKit Review Bot 2012-07-19 07:59:46 PDT
Comment on attachment 153246 [details]
Patch

Clearing flags on attachment: 153246

Committed r123103: <http://trac.webkit.org/changeset/123103>
Comment 5 WebKit Review Bot 2012-07-19 07:59:51 PDT
All reviewed patches have been landed.  Closing bug.