Commit 155befa5 authored by bdakin's avatar bdakin

Reviewed by Adam.

        Fix for <rdar://problem/4863434> Wrong contextual menu appears for 
        textarea and input elements at http://www.apple.com/feedback/
        ical.html

        No test cases added since context menus are not in DRT.

        * page/ContextMenuController.cpp: 
        (WebCore::ContextMenuController::handleContextMenuEvent): Call 
        EventHandler's hitTestResultAtPoint() instead of just hit testing 
        the layer.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@18633 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 367f3523
2007-01-05 Beth Dakin <bdakin@apple.com>
Reviewed by Adam.
Fix for <rdar://problem/4863434> Wrong contextual menu appears for
textarea and input elements at http://www.apple.com/feedback/
ical.html
No test cases added since context menus are not in DRT.
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::handleContextMenuEvent): Call
EventHandler's hitTestResultAtPoint() instead of just hit testing
the layer.
2007-01-05 Anders Carlsson <acarlsson@apple.com>
Rubber-stamped by Adam.
......
......@@ -35,6 +35,7 @@
#include "Editor.h"
#include "EditorClient.h"
#include "Event.h"
#include "EventHandler.h"
#include "EventNames.h"
#include "Frame.h"
#include "FrameLoader.h"
......@@ -72,22 +73,15 @@ void ContextMenuController::handleContextMenuEvent(Event* event)
{
ASSERT(event->type() == contextmenuEvent);
MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
HitTestResult result(IntPoint(mouseEvent->pageX(), mouseEvent->pageY()));
IntPoint point = IntPoint(mouseEvent->pageX(), mouseEvent->pageY());
HitTestResult result(point);
if (RenderObject* renderer = event->target()->toNode()->renderer())
if (RenderLayer* layer = renderer->enclosingLayer())
layer->hitTest(HitTestRequest(false, true), result);
if (!result.innerNonSharedNode()) {
Frame* mainFrame = m_page->mainFrame();
if (!mainFrame)
return;
Document* document = mainFrame->document();
if (!document)
return;
result.setInnerNonSharedNode(document);
result.setInnerNode(document);
}
if (Document* document = event->target()->toNode()->document())
if (Frame* frame = document->frame())
result = frame->eventHandler()->hitTestResultAtPoint(point, false);
if (!result.innerNonSharedNode())
return;
m_contextMenu.set(new ContextMenu(result));
m_contextMenu->populate();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment