Changeset 85259 in webkit


Ignore:
Timestamp:
Apr 28, 2011 4:44:26 PM (13 years ago)
Author:
andersca@apple.com
Message:

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):
Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r85256 r85259  
     12011-04-28  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        Right-clicking on a Flash movie in an iframe shows the browser context menu
     6        https://bugs.webkit.org/show_bug.cgi?id=59760
     7        <rdar://problem/9340541>
     8
     9        Move context menu event handling out into a separate function. Make sure to call
     10        EventHandler::sendContextMenuEvent on the event handler belonging to the frame of the
     11        node that was clicked, and not the main frame.
     12
     13        * WebProcess/WebPage/WebPage.cpp:
     14        (WebKit::handleContextMenuEvent):
     15        (WebKit::handleMouseEvent):
     16
    1172011-04-28  Adam Barth  <abarth@webkit.org>
    218
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r84648 r85259  
    922922}
    923923
     924static bool handleContextMenuEvent(const PlatformMouseEvent& platformMouseEvent, Page* page)
     925{
     926    IntPoint point = page->mainFrame()->view()->windowToContents(platformMouseEvent.pos());
     927    HitTestResult result = page->mainFrame()->eventHandler()->hitTestResultAtPoint(point, false);
     928
     929    Frame* frame = page->mainFrame();
     930    if (result.innerNonSharedNode())
     931        frame = result.innerNonSharedNode()->document()->frame();
     932   
     933    bool handled = frame->eventHandler()->sendContextMenuEvent(platformMouseEvent);
     934    if (handled)
     935        page->chrome()->showContextMenu();
     936
     937    return handled;
     938}
     939
    924940static bool handleMouseEvent(const WebMouseEvent& mouseEvent, Page* page)
    925941{
     
    937953           
    938954            bool handled = frame->eventHandler()->handleMousePressEvent(platformMouseEvent);
    939            
    940             if (isContextClick(platformMouseEvent)) {
    941                 handled = frame->eventHandler()->sendContextMenuEvent(platformMouseEvent);
    942                 if (handled)
    943                     page->chrome()->showContextMenu();
    944             }
     955            if (isContextClick(platformMouseEvent))
     956                handled = handleContextMenuEvent(platformMouseEvent, page);
    945957
    946958            return handled;
Note: See TracChangeset for help on using the changeset viewer.