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

eric at webkit.org eric at webkit.org
Wed Apr 7 23:47:41 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit dbf49992eb7a2875daa58054bf103e42fd230b24
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Nov 18 23:10:54 2009 +0000

    2009-11-18  Evan Stade  <estade at chromium.org>
    
            Reviewed by Darin Fisher.
    
            Menu button shows wrong content in Chromium
            https://bugs.webkit.org/show_bug.cgi?id=31448
    
            Make context menu button (VK_APPS) show context menu for node that has
            keyboard focus. This affects both the content and the positioning.
    
            * src/WebViewImpl.cpp:
            (WebKit::WebViewImpl::sendContextMenuEvent):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51142 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 0aafd2b..1545dd8 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,16 @@
+2009-11-18  Evan Stade  <estade at chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Menu button shows wrong content in Chromium
+        https://bugs.webkit.org/show_bug.cgi?id=31448
+
+        Make context menu button (VK_APPS) show context menu for node that has
+        keyboard focus. This affects both the content and the positioning.
+
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::sendContextMenuEvent):
+
 2009-11-17  Darin Fisher  <darin at chromium.org>
 
         Reviewed by Dmitry Titov.
diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp
index 3a569a9..aaf7174 100644
--- a/WebKit/chromium/src/WebViewImpl.cpp
+++ b/WebKit/chromium/src/WebViewImpl.cpp
@@ -587,11 +587,10 @@ bool WebViewImpl::sendContextMenuEvent(const WebKeyboardEvent& event)
     Position start = mainFrameImpl->selection()->selection().start();
     Position end = mainFrameImpl->selection()->selection().end();
 
-    if (!start.node() || !end.node()) {
-        location = IntPoint(
-            rightAligned ? view->contentsWidth() - kContextMenuMargin : kContextMenuMargin,
-            kContextMenuMargin);
-    } else {
+    Frame* focusedFrame = page()->focusController()->focusedOrMainFrame();
+    Node* focusedNode = focusedFrame->document()->focusedNode();
+
+    if (start.node() && end.node()) {
         RenderObject* renderer = start.node()->renderer();
         if (!renderer)
             return false;
@@ -601,6 +600,12 @@ bool WebViewImpl::sendContextMenuEvent(const WebKeyboardEvent& event)
 
         int x = rightAligned ? firstRect.right() : firstRect.x();
         location = IntPoint(x, firstRect.bottom());
+    } else if (focusedNode)
+        location = focusedNode->getRect().bottomLeft();
+    else {
+        location = IntPoint(
+            rightAligned ? view->contentsWidth() - kContextMenuMargin : kContextMenuMargin,
+            kContextMenuMargin);
     }
 
     location = view->contentsToWindow(location);
@@ -617,7 +622,6 @@ bool WebViewImpl::sendContextMenuEvent(const WebKeyboardEvent& event)
     // not run.
     page()->contextMenuController()->clearContextMenu();
 
-    Frame* focusedFrame = page()->focusController()->focusedOrMainFrame();
     focusedFrame->view()->setCursor(pointerCursor());
     WebMouseEvent mouseEvent;
     mouseEvent.button = WebMouseEvent::ButtonRight;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list