Bug 91645 - [Qt][WK2] Map the elementRect exposed in QML to the view for popup menu
Summary: [Qt][WK2] Map the elementRect exposed in QML to the view for popup menu
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Pierre Rossi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-18 11:29 PDT by Pierre Rossi
Modified: 2012-07-19 07:59 PDT (History)
5 users (show)

See Also:


Attachments
Patch (5.06 KB, patch)
2012-07-18 11:34 PDT, Pierre Rossi
no flags Details | Formatted Diff | Diff
Patch (5.08 KB, patch)
2012-07-19 06:40 PDT, Pierre Rossi
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.