[Webkit-unassigned] [Bug 49376] [GTK] Show default context menu for the currently focused element when activated with keyboard

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Nov 11 09:48:06 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=49376


Martin Robinson <mrobinson at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #73599|review?                     |review-
               Flag|                            |




--- Comment #2 from Martin Robinson <mrobinson at webkit.org>  2010-11-11 09:48:06 PST ---
(From update of attachment 73599)
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()) {
        ...
    }
}

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list