RESOLVED FIXED 138311
[GTK] Add context menu API to Web Process Extensions
https://bugs.webkit.org/show_bug.cgi?id=138311
Summary [GTK] Add context menu API to Web Process Extensions
Carlos Garcia Campos
Reported 2014-11-03 08:31:06 PST
Useful when the information in the UI process is not enough to build or customize the context menu, for example, when you need to access the Node of the hit test result.
Attachments
Patch (45.60 KB, patch)
2014-11-03 11:10 PST, Carlos Garcia Campos
no flags
Updated patch (45.46 KB, patch)
2014-11-06 02:34 PST, Carlos Garcia Campos
gustavo: review+
Carlos Garcia Campos
Comment 1 2014-11-03 11:10:42 PST
WebKit Commit Bot
Comment 2 2014-11-03 11:13:53 PST
Attachment 240864 [details] did not pass style-queue: WARNING: File exempt from style guide. Skipping: "Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.h" WARNING: File exempt from style guide. Skipping: "Source/WebKit2/UIProcess/API/gtk/WebKitContextMenu.h" ERROR: Source/WebKit2/PlatformGTK.cmake:376: Alphabetical sorting problem. "" <file alias=\"images/missingImage@2x\">missingImage@2x.png</file>\n"" should be before "" <file alias=\"images/missingImage\">missingImage.png</file>\n"". [list/order] [5] WARNING: File exempt from style guide. Skipping: "Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.h" WARNING: File exempt from style guide. Skipping: "Source/WebKit2/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h" WARNING: File exempt from style guide. Skipping: "Source/WebKit2/UIProcess/API/gtk/WebKitForwardDeclarations.h" WARNING: File exempt from style guide. Skipping: "Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItem.h" WARNING: File exempt from style guide. Skipping: "Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.h" Total errors found: 1 in 22 files If any of these errors are false positives, please file a bug against check-webkit-style.
Gustavo Noronha (kov)
Comment 3 2014-11-04 05:53:21 PST
Comment on attachment 240864 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=240864&action=review I like the idea and the API, the code looks correct to me as well. > Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:257 > + } else { > + WKRetain(wkDefaultMenu); > + *wkNewMenu = wkDefaultMenu; > + } How about making this an early return?
Carlos Garcia Campos
Comment 4 2014-11-04 06:17:14 PST
(In reply to comment #3) > Comment on attachment 240864 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=240864&action=review > > I like the idea and the API, the code looks correct to me as well. This is needed by Yelp, I'll try to use this in yelp asap to make sure the API is good. > > Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:257 > > + } else { > > + WKRetain(wkDefaultMenu); > > + *wkNewMenu = wkDefaultMenu; > > + } > > How about making this an early return? Sure.
Marcos Chavarría Teijeiro (irc: chavaone)
Comment 5 2014-11-05 01:10:46 PST
Yelp (the GNOME help viewer) needs to access the DOM tree when we generate the context menu to check if we are clicking a piece of code or to get the link title. I have use this patch to implement this feature and it works really well!! Great work!!
Carlos Garcia Campos
Comment 6 2014-11-06 02:34:04 PST
Created attachment 241099 [details] Updated patch
WebKit Commit Bot
Comment 7 2014-11-06 02:36:34 PST
Attachment 241099 [details] did not pass style-queue: WARNING: File exempt from style guide. Skipping: "Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.h" WARNING: File exempt from style guide. Skipping: "Source/WebKit2/UIProcess/API/gtk/WebKitContextMenu.h" ERROR: Source/WebKit2/PlatformGTK.cmake:376: There should be exactly one empty line instead of 0 between "" <file alias=\"images/panIcon\">panIcon.png</file>\n"" and "" <file alias=\"images/textAreaResizeCorner\">textAreaResizeCorner.png</file>\n"". [list/emptyline] [5] WARNING: File exempt from style guide. Skipping: "Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.h" WARNING: File exempt from style guide. Skipping: "Source/WebKit2/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h" WARNING: File exempt from style guide. Skipping: "Source/WebKit2/UIProcess/API/gtk/WebKitForwardDeclarations.h" WARNING: File exempt from style guide. Skipping: "Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItem.h" WARNING: File exempt from style guide. Skipping: "Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.h" Total errors found: 1 in 22 files If any of these errors are false positives, please file a bug against check-webkit-style.
Carlos Garcia Campos
Comment 8 2014-11-06 07:08:08 PST
Note You need to log in before you can comment on or make changes to this bug.