When context menu is activated with keyboard only selections are handled, when nothing is selected the default context menu is shown on top-left corner. If there's a focused element, like a link, the context menu for such element should be used and should be correctly positioned.
Created attachment 73599 [details] Patch to show context menu for focused items when using the keyboard
Comment on attachment 73599 [details] Patch to show context menu for focused items when using the keyboard View in context: https://bugs.webkit.org/attachment.cgi?id=73599&action=review > WebKit/gtk/webkit/webkitwebview.cpp:347 > + || (frame->selection()->selection().isCaret() && !frame->selection()->selection().isContentEditable())) { > + // If there's a focused elment, use its location. > + bool locationSet = false; > + Document* doc = frame->document(); > + if (doc) { I think maybe we should break out this block out into a helper function...perhaps everyting from the start of this block to the FIXME. getActiveNodeLocation or something similar? This will simplify things by allowing early returns (you can do away with the locationSet variable). You can also simplify this further by doing something like: if (Document* doc = frame->document()) { if (Node* focusedNode = doc->focusedNode()) { ... } }
Created attachment 73707 [details] Updated patch I've added a method getFocusedNode() that just returns the currently focused node, because it's more generic and I'll be able to use it for bug #25525 too.
Comment on attachment 73707 [details] Updated patch Clearing flags on attachment: 73707 Committed r72109: <http://trac.webkit.org/changeset/72109>
All reviewed patches have been landed. Closing bug.