Bug 86625 - [Chromium] Implement the ContextMenuItem SubMenu type
Summary: [Chromium] Implement the ContextMenuItem SubMenu type
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alexander Pavlov (apavlov)
URL:
Keywords:
Depends on:
Blocks: 86630 86847
  Show dependency treegraph
 
Reported: 2012-05-16 07:18 PDT by Alexander Pavlov (apavlov)
Modified: 2012-05-22 07:31 PDT (History)
8 users (show)

See Also:


Attachments
Patch (10.18 KB, patch)
2012-05-16 07:43 PDT, Alexander Pavlov (apavlov)
no flags Details | Formatted Diff | Diff
Patch (10.16 KB, patch)
2012-05-18 03:06 PDT, Alexander Pavlov (apavlov)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Pavlov (apavlov) 2012-05-16 07:18:47 PDT
This is necessary for rendering submenu items in the Web Inspector's context menu.
Comment 1 Alexander Pavlov (apavlov) 2012-05-16 07:35:13 PDT
The bug is tracked downstream as https://code.google.com/p/chromium/issues/detail?id=128351 as it requires the Chromium non-WebKit code changes.
Comment 2 Alexander Pavlov (apavlov) 2012-05-16 07:43:04 PDT
Created attachment 142261 [details]
Patch
Comment 3 WebKit Review Bot 2012-05-16 07:46:53 PDT
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
Comment 4 Adam Barth 2012-05-16 19:53:50 PDT
Comment on attachment 142261 [details]
Patch

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

The API change LGTM.  The rest of the patch looks plausible, but I'm not the right person to review it.

> Source/WebCore/platform/chromium/ContextMenuChromium.cpp:68
> +    Vector<Vector<ContextMenuItem>*> menuItemStack;

Would it be better to use Vector<Vector<ContextMenuItem>&> to avoid all the conversion back and forth between references and pointers?
Comment 5 Alexander Pavlov (apavlov) 2012-05-17 04:32:56 PDT
(In reply to comment #4)

> Would it be better to use Vector<Vector<ContextMenuItem>&> to avoid all the conversion back and forth between references and pointers?

Does not compile for me: gives a bunch of messages like
../../third_party/WebKit/Source/WTF/wtf/Vector.h:489: error: forming pointer to reference type 'WTF::Vector<WebCore::ContextMenuItem, 0ul>&'
(which refers to "typedef T* iterator;").
Comment 6 Adam Barth 2012-05-17 04:51:06 PDT
Interesting.
Comment 7 Kent Tamura 2012-05-18 02:57:15 PDT
Comment on attachment 142261 [details]
Patch

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

> Source/WebKit/chromium/public/WebMenuItemInfo.h:68
>      bool hasTextDirectionOverride;
>      bool enabled;
>      bool checked;
> +    WebVector<WebMenuItemInfo> subMenuItems;

We had better put subMenuItems before hasTextDirectionOverride to minimize padding.
Other than this point, WebKit API change looks ok.
Comment 8 Alexander Pavlov (apavlov) 2012-05-18 03:06:29 PDT
Created attachment 142676 [details]
Patch
Comment 9 WebKit Review Bot 2012-05-22 07:31:45 PDT
Comment on attachment 142676 [details]
Patch

Clearing flags on attachment: 142676

Committed r117970: <http://trac.webkit.org/changeset/117970>
Comment 10 WebKit Review Bot 2012-05-22 07:31:50 PDT
All reviewed patches have been landed.  Closing bug.