Commit 1b582bcf authored by andersca@apple.com's avatar andersca@apple.com

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

        Reviewed by Simon Fraser.

        Clicks not recognized on http://www.nibblestutorials.net/ which uses Silverlight
        https://bugs.webkit.org/show_bug.cgi?id=58108
        <rdar://problem/9167611>

        Change platformHandleMouseEvent to return true, which means that the plug-in has handled the
        event. Some plug-ins (like Silverlight) will return false from NPP_HandleEvent even though the
        event has been handled. In this case it lead to a very subtle bug where the plug-in element would
        lose focus right after a mouse down even had been sent.

        * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
        (WebKit::NetscapePlugin::platformHandleMouseEvent):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83306 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d0941063
......@@ -2175,6 +2175,7 @@ bool EventHandler::sendContextMenuEvent(const PlatformMouseEvent& event)
selectClosestWordOrLinkFromMouseEvent(mev);
}
printf("node: %s\n", targetNode(mev)->nodeName().utf8().data());
swallowEvent = dispatchMouseEvent(eventNames().contextmenuEvent, targetNode(mev), true, 0, event, false);
return swallowEvent;
......
2011-04-07 Anders Carlsson <andersca@apple.com>
Reviewed by Simon Fraser.
Clicks not recognized on http://www.nibblestutorials.net/ which uses Silverlight
https://bugs.webkit.org/show_bug.cgi?id=58108
<rdar://problem/9167611>
Change platformHandleMouseEvent to return true, which means that the plug-in has handled the
event. Some plug-ins (like Silverlight) will return false from NPP_HandleEvent even though the
event has been handled. In this case it lead to a very subtle bug where the plug-in element would
lose focus right after a mouse down even had been sent.
* WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
(WebKit::NetscapePlugin::platformHandleMouseEvent):
2011-04-07 Adam Roben <aroben@apple.com>
Pass NPP_SetWindow a null window handle during plugin destruction on non-Mac platforms
......
......@@ -508,11 +508,14 @@ bool NetscapePlugin::platformHandleMouseEvent(const WebMouseEvent& mouseEvent)
// access m_currentMouseEvent afterwards.
RefPtr<NetscapePlugin> protect(this);
bool returnValue = NPP_HandleEvent(&event);
NPP_HandleEvent(&event);
m_currentMouseEvent = previousMouseEvent;
return returnValue;
// Some plug-ins return false even if the mouse event has been handled.
// This leads to bugs such as <rdar://problem/9167611>. Work around this
// by always returning true.
return true;
}
#ifndef NP_NO_CARBON
......@@ -540,7 +543,12 @@ bool NetscapePlugin::platformHandleMouseEvent(const WebMouseEvent& mouseEvent)
event.where.h = mouseEvent.globalPosition().x();
event.where.v = mouseEvent.globalPosition().y();
return NPP_HandleEvent(&event);
NPP_HandleEvent(&event);
// Some plug-ins return false even if the mouse event has been handled.
// This leads to bugs such as <rdar://problem/9167611>. Work around this
// by always returning true.
return true;
}
#endif
......
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