[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 00:35:59 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 96c25a81883d677102bff7a47198557a72d3739b
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Dec 14 22:45:35 2009 +0000

    2009-12-14  Evan Stade  <estade at chromium.org>
    
            Reviewed by Darin Fisher.
    
            https://bugs.webkit.org/show_bug.cgi?id=32347
            Chromium: Context menu launched by menu key has funky behavior
    
            Make the context menu's position depend on the selection only when an
            editable field has focus. Also, don't send multiple context menu events
            for a single keypress.
    
            * src/WebViewImpl.cpp:
            (WebKit::WebViewImpl::keyEvent):
            (WebKit::WebViewImpl::sendContextMenuEvent):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52124 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index d5d5c2d..483d7a8 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,18 @@
+2009-12-14  Evan Stade  <estade at chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        https://bugs.webkit.org/show_bug.cgi?id=32347
+        Chromium: Context menu launched by menu key has funky behavior
+
+        Make the context menu's position depend on the selection only when an
+        editable field has focus. Also, don't send multiple context menu events
+        for a single keypress.
+
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::keyEvent):
+        (WebKit::WebViewImpl::sendContextMenuEvent):
+
 2009-12-13  Sam Weinig  <sam at webkit.org>
 
         Reviewed by Dan Bernstein.
diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp
index 030c4bd..87a150a 100644
--- a/WebKit/chromium/src/WebViewImpl.cpp
+++ b/WebKit/chromium/src/WebViewImpl.cpp
@@ -453,8 +453,16 @@ bool WebViewImpl::keyEvent(const WebKeyboardEvent& event)
         return keyEventDefault(event);
 
 #if PLATFORM(WIN_OS) || PLATFORM(LINUX)
-    if ((!event.modifiers && (event.windowsKeyCode == VKEY_APPS))
-        || ((event.modifiers == WebInputEvent::ShiftKey) && (event.windowsKeyCode == VKEY_F10))) {
+    const WebInputEvent::Type contextMenuTriggeringEventType =
+#if PLATFORM(WIN_OS)
+        WebInputEvent::KeyUp;
+#elif PLATFORM(LINUX)
+        WebInputEvent::RawKeyDown;
+#endif
+
+    if (((!event.modifiers && (event.windowsKeyCode == VKEY_APPS))
+        || ((event.modifiers == WebInputEvent::ShiftKey) && (event.windowsKeyCode == VKEY_F10)))
+        && event.type == contextMenuTriggeringEventType) {
         sendContextMenuEvent(event);
         return true;
     }
@@ -592,15 +600,12 @@ bool WebViewImpl::sendContextMenuEvent(const WebKeyboardEvent& event)
 #endif
     IntPoint location;
 
-    // The context menu event was generated from the keyboard, so show the
-    // context menu by the current selection.
-    Position start = mainFrameImpl->selection()->selection().start();
-    Position end = mainFrameImpl->selection()->selection().end();
 
     Frame* focusedFrame = page()->focusController()->focusedOrMainFrame();
     Node* focusedNode = focusedFrame->document()->focusedNode();
+    Position start = mainFrameImpl->selection()->selection().start();
 
-    if (start.node() && end.node()) {
+    if (focusedFrame->editor() && focusedFrame->editor()->canEdit() && start.node()) {
         RenderObject* renderer = start.node()->renderer();
         if (!renderer)
             return false;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list