Commit 07fa282e authored by bdakin's avatar bdakin

Reviewed by Adele.

        Fix for <rdar://problem/4939558> REGRESSION: "Search in Google", 
        "Search in Spotlight" and "Look up in Dictionary" are missing 
        initially from the contextual menu

        The bug here is that we select the we were selecting the word after 
        the context menu event was dispatched and after the context menu 
        was built up.

        * page/EventHandler.cpp:
        (WebCore::EventHandler::sendContextMenuEvent): Select the word 
        before dispatching the event. It is safe to remove the check for 
        swallowEvent since WebCore context menus ensure that we always 
        swallow the event anyway.


git-svn-id: svn://svn.chromium.org/blink/trunk@18974 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 5fa163a4
2007-01-18 Beth Dakin <bdakin@apple.com>
Reviewed by Adele.
Fix for <rdar://problem/4939558> REGRESSION: "Search in Google",
"Search in Spotlight" and "Look up in Dictionary" are missing
initially from the contextual menu
The bug here is that we select the we were selecting the word after
the context menu event was dispatched and after the context menu
was built up.
* page/EventHandler.cpp:
(WebCore::EventHandler::sendContextMenuEvent): Select the word
before dispatching the event. It is safe to remove the check for
swallowEvent since WebCore context menus ensure that we always
swallow the event anyway.
2007-01-18 Mark Rowe <mrowe@apple.com> 2007-01-18 Mark Rowe <mrowe@apple.com>
Reviewed by Tim H. Reviewed by Tim H.
......
...@@ -1110,14 +1110,15 @@ bool EventHandler::sendContextMenuEvent(PlatformMouseEvent event) ...@@ -1110,14 +1110,15 @@ bool EventHandler::sendContextMenuEvent(PlatformMouseEvent event)
bool swallowEvent; bool swallowEvent;
IntPoint viewportPos = v->windowToContents(event.pos()); IntPoint viewportPos = v->windowToContents(event.pos());
MouseEventWithHitTestResults mev = doc->prepareMouseEvent(HitTestRequest(false, true), viewportPos, event); MouseEventWithHitTestResults mev = doc->prepareMouseEvent(HitTestRequest(false, true), viewportPos, event);
swallowEvent = dispatchMouseEvent(contextmenuEvent, mev.targetNode(), true, 0, event, true); if (!m_frame->selectionController()->contains(viewportPos) &&
if (swallowEvent && !m_frame->selectionController()->contains(viewportPos) &&
(m_frame->editor()->selectWordBeforeMenuEvent() || m_frame->editor()->clientIsEditable() (m_frame->editor()->selectWordBeforeMenuEvent() || m_frame->editor()->clientIsEditable()
|| (mev.targetNode() && mev.targetNode()->isContentEditable()))) { || (mev.targetNode() && mev.targetNode()->isContentEditable()))) {
m_mouseDownMayStartSelect = true; // context menu events are always allowed to perform a selection m_mouseDownMayStartSelect = true; // context menu events are always allowed to perform a selection
selectClosestWordFromMouseEvent(mev); selectClosestWordFromMouseEvent(mev);
} }
swallowEvent = dispatchMouseEvent(contextmenuEvent, mev.targetNode(), true, 0, event, true);
return swallowEvent; return swallowEvent;
} }
......
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