Bug 51825 - [Qt] [WK2] create an initial implementation of the context menu handling for WebKit 2
Summary: [Qt] [WK2] create an initial implementation of the context menu handling for ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P3 Minor
Assignee: Benjamin Poulain
URL:
Keywords: Qt, QtTriaged
Depends on:
Blocks: 51902
  Show dependency treegraph
 
Reported: 2011-01-03 09:57 PST by Benjamin Poulain
Modified: 2011-01-04 15:19 PST (History)
1 user (show)

See Also:


Attachments
Patch (11.86 KB, patch)
2011-01-03 10:07 PST, Benjamin Poulain
no flags Details | Formatted Diff | Diff
Kenneth, is that what you had in mind to find the correct view? (12.03 KB, patch)
2011-01-04 03:22 PST, Benjamin Poulain
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Poulain 2011-01-03 09:57:03 PST
Qt does not handle the context menu on WebKit 2 at the moment, fix that :)
Comment 1 Benjamin Poulain 2011-01-03 10:07:06 PST
Created attachment 77814 [details]
Patch
Comment 2 Kenneth Rohde Christiansen 2011-01-03 11:26:11 PST
Comment on attachment 77814 [details]
Patch

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

> WebCore/platform/qt/ContextMenuQt.cpp:76
> +Vector<ContextMenuItem> contextMenuItemVector(PlatformMenuDescription platformDescription)

I would just write "description",  but as this is already paltform code, I would replace PlatformMenuDescription with what it is defined to, ie QList<ContextMenuItem>.

> WebKit2/UIProcess/API/qt/qgraphicswkview.cpp:330
> +    // Remove the active menu in case this function is called twice.

I think it is called "in the case". You can replace twice with repeatedly.

> WebKit2/UIProcess/API/qt/qgraphicswkview.cpp:341
> +    // FIXME: try to determine the view from the position of the incoming events?
> +    QWidget* view = 0;
> +    if (QGraphicsScene* myScene = scene()) {
> +        const QList<QGraphicsView*> views = myScene->views();
> +        view = views.value(0, 0);
> +    }

Did you see how I did this with the vkb? I think that I tried handling this.

> WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp:49
> +    default: break;

I think break should go to the next line

> WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp:109
> +
> +    // don't show sub-menus with just disabled actions

With capital and ending with a dot

> WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp:114
> +    bool anyEnabledAction = false;

anyActionEnabled, anyActionWasEnabled? depending on what it really represents.
Comment 3 Benjamin Poulain 2011-01-04 03:22:10 PST
Created attachment 77876 [details]
Kenneth, is that what you had in mind to find the correct view?
Comment 4 Benjamin Poulain 2011-01-04 03:24:46 PST
(And thanks for reviewing the patch by the way)
Comment 5 WebKit Commit Bot 2011-01-04 03:53:43 PST
Comment on attachment 77876 [details]
Kenneth, is that what you had in mind to find the correct view?

Clearing flags on attachment: 77876

Committed r74964: <http://trac.webkit.org/changeset/74964>
Comment 6 WebKit Commit Bot 2011-01-04 03:53:49 PST
All reviewed patches have been landed.  Closing bug.