Commit 938f519e authored by andersca@apple.com's avatar andersca@apple.com
Browse files

2011-04-28 Anders Carlsson <andersca@apple.com>

        Reviewed by Darin Adler.

        Right-clicking on a Flash movie in an iframe shows the browser context menu
        https://bugs.webkit.org/show_bug.cgi?id=59760
        <rdar://problem/9340541>

        Move context menu event handling out into a separate function. Make sure to call
        EventHandler::sendContextMenuEvent on the event handler belonging to the frame of the
        node that was clicked, and not the main frame.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::handleContextMenuEvent):
        (WebKit::handleMouseEvent):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@85259 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 809f76ae
2011-04-28 Anders Carlsson <andersca@apple.com>
Reviewed by Darin Adler.
Right-clicking on a Flash movie in an iframe shows the browser context menu
https://bugs.webkit.org/show_bug.cgi?id=59760
<rdar://problem/9340541>
Move context menu event handling out into a separate function. Make sure to call
EventHandler::sendContextMenuEvent on the event handler belonging to the frame of the
node that was clicked, and not the main frame.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::handleContextMenuEvent):
(WebKit::handleMouseEvent):
2011-04-28 Adam Barth <abarth@webkit.org>
 
Reviewed by Eric Seidel.
......
......@@ -921,6 +921,22 @@ static bool isContextClick(const PlatformMouseEvent& event)
return false;
}
static bool handleContextMenuEvent(const PlatformMouseEvent& platformMouseEvent, Page* page)
{
IntPoint point = page->mainFrame()->view()->windowToContents(platformMouseEvent.pos());
HitTestResult result = page->mainFrame()->eventHandler()->hitTestResultAtPoint(point, false);
Frame* frame = page->mainFrame();
if (result.innerNonSharedNode())
frame = result.innerNonSharedNode()->document()->frame();
bool handled = frame->eventHandler()->sendContextMenuEvent(platformMouseEvent);
if (handled)
page->chrome()->showContextMenu();
return handled;
}
static bool handleMouseEvent(const WebMouseEvent& mouseEvent, Page* page)
{
Frame* frame = page->mainFrame();
......@@ -936,12 +952,8 @@ static bool handleMouseEvent(const WebMouseEvent& mouseEvent, Page* page)
page->contextMenuController()->clearContextMenu();
bool handled = frame->eventHandler()->handleMousePressEvent(platformMouseEvent);
if (isContextClick(platformMouseEvent)) {
handled = frame->eventHandler()->sendContextMenuEvent(platformMouseEvent);
if (handled)
page->chrome()->showContextMenu();
}
if (isContextClick(platformMouseEvent))
handled = handleContextMenuEvent(platformMouseEvent, page);
return handled;
}
......
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