2008-12-29 Josh Roesslein <jroesslein@gmail.com>
authoroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Dec 2008 05:10:21 +0000 (05:10 +0000)
committeroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Dec 2008 05:10:21 +0000 (05:10 +0000)
Reviewed by Oliver Hunt.

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

Context menu rendering error when full page zoomed

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@39506 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/page/ContextMenuController.cpp

index a2c4127..f9de570 100644 (file)
@@ -1,3 +1,14 @@
+2008-12-29  Josh Roesslein  <jroesslein@gmail.com>
+
+        Reviewed by Oliver Hunt.
+
+        Fixes: https://bugs.webkit.org/show_bug.cgi?id=22968
+
+        Context menu rendering error when full page zoomed
+
+        * page/ContextMenuController.cpp:
+        (WebCore::ContextMenuController::handleContextMenuEvent):
+
 2008-12-29  Sam Weinig  <sam@webkit.org>
 
         Reviewed by Mark Rowe.
index 8d7e51a..5e9f8b5 100644 (file)
@@ -86,9 +86,13 @@ void ContextMenuController::handleContextMenuEvent(Event* event)
     IntPoint point = IntPoint(mouseEvent->pageX(), mouseEvent->pageY());
     HitTestResult result(point);
 
-    if (Frame* frame = event->target()->toNode()->document()->frame())
+    if (Frame* frame = event->target()->toNode()->document()->frame()) {
+        float zoomFactor = frame->pageZoomFactor();
+        point.setX(static_cast<int>(point.x() * zoomFactor));
+        point.setY(static_cast<int>(point.y() * zoomFactor));
         result = frame->eventHandler()->hitTestResultAtPoint(point, false);
-    
+    }
+
     if (!result.innerNonSharedNode())
         return;