Commit eb026f3e authored by ap@apple.com's avatar ap@apple.com
Browse files

Reviewed by Geoffrey Garen and Kevin Decker.

        https://bugs.webkit.org/show_bug.cgi?id=34989
        <rdar://problem/7417965> Cursor disappears on scroll bars that are over plugin content

        This fixes event dispatch for both Cocoa and Carbon event models (mouseEntered/mouseExited
        in the former case, and adjustCursor in the latter).

        * Plugins/Hosted/WebHostedNetscapePluginView.mm:
        (-[WebHostedNetscapePluginView handleMouseEntered:]):
        (-[WebHostedNetscapePluginView handleMouseExited:]):
        * Plugins/WebBaseNetscapePluginView.h:
        * Plugins/WebBaseNetscapePluginView.mm:
        (-[WebBaseNetscapePluginView handleMouseEntered:]):
        (-[WebBaseNetscapePluginView handleMouseExited:]):
        * Plugins/WebNetscapePluginView.h:
        * Plugins/WebNetscapePluginView.mm:
        (-[WebNetscapePluginView handleMouseEntered:]):
        (-[WebNetscapePluginView handleMouseExited:]):
        AppKit cannot reliably dispatch events for overlapping views. We are now asking WebCore to
        notify plug-in views of mouse entered/exited as part of DOM event dispatch.

        * WebCoreSupport/WebFrameLoaderClient.mm: (NetscapePluginWidget::handleEvent): Besides
        mouse moved, dispatch plugin mouse entered/exit events in HTMLPlugInElement default event
        handler. Other mouse events are passed down by EventHandler.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54829 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8ab03274
2010-02-16 Alexey Proskuryakov <ap@apple.com>
Reviewed by Geoffrey Garen and Kevin Decker.
https://bugs.webkit.org/show_bug.cgi?id=34989
<rdar://problem/7417965> Cursor disappears on scroll bars that are over plugin content
* html/HTMLPlugInElement.cpp: (WebCore::HTMLPlugInElement::defaultEventHandler): Added some
comments about the way we pass events down to plug-ins.
2010-02-16 Simon Fraser <simon.fraser@apple.com>
Reviewed by Eric Carlson.
......
......@@ -151,6 +151,12 @@ bool HTMLPlugInElement::checkDTD(const Node* newChild)
void HTMLPlugInElement::defaultEventHandler(Event* event)
{
// Firefox seems to use a fake event listener to dispatch events to plug-in (tested with mouse events only).
// This is observable via different order of events - in Firefox, event listeners specified in HTML attributes fires first, then an event
// gets dispatched to plug-in, and only then other event listeners fire. Hopefully, this difference does not matter in practice.
// FIXME: Mouse down and scroll events are passed down to plug-in via custom code in EventHandler; these code paths should be united.
RenderObject* r = renderer();
if (!r || !r->isWidget())
return;
......
2010-02-16 Alexey Proskuryakov <ap@apple.com>
Reviewed by Geoffrey Garen and Kevin Decker.
https://bugs.webkit.org/show_bug.cgi?id=34989
<rdar://problem/7417965> Cursor disappears on scroll bars that are over plugin content
This fixes event dispatch for both Cocoa and Carbon event models (mouseEntered/mouseExited
in the former case, and adjustCursor in the latter).
* Plugins/Hosted/WebHostedNetscapePluginView.mm:
(-[WebHostedNetscapePluginView handleMouseEntered:]):
(-[WebHostedNetscapePluginView handleMouseExited:]):
* Plugins/WebBaseNetscapePluginView.h:
* Plugins/WebBaseNetscapePluginView.mm:
(-[WebBaseNetscapePluginView handleMouseEntered:]):
(-[WebBaseNetscapePluginView handleMouseExited:]):
* Plugins/WebNetscapePluginView.h:
* Plugins/WebNetscapePluginView.mm:
(-[WebNetscapePluginView handleMouseEntered:]):
(-[WebNetscapePluginView handleMouseExited:]):
AppKit cannot reliably dispatch events for overlapping views. We are now asking WebCore to
notify plug-in views of mouse entered/exited as part of DOM event dispatch.
* WebCoreSupport/WebFrameLoaderClient.mm: (NetscapePluginWidget::handleEvent): Besides
mouse moved, dispatch plugin mouse entered/exit events in HTMLPlugInElement default event
handler. Other mouse events are passed down by EventHandler.
2010-02-15 Alexey Proskuryakov <ap@apple.com>
More build fixing (for what is actually a 64-bit failure, as 32-bit apparently includes
......
......@@ -285,13 +285,13 @@ extern "C" {
_proxy->mouseEvent(self, event, NPCocoaEventMouseDragged);
}
- (void)mouseEntered:(NSEvent *)event
- (void)handleMouseEntered:(NSEvent *)event
{
if (_isStarted && _proxy)
_proxy->mouseEvent(self, event, NPCocoaEventMouseEntered);
}
- (void)mouseExited:(NSEvent *)event
- (void)handleMouseExited:(NSEvent *)event
{
if (_isStarted && _proxy)
_proxy->mouseEvent(self, event, NPCocoaEventMouseExited);
......
......@@ -92,7 +92,10 @@ class WebHaltablePlugin;
- (NSMutableURLRequest *)requestWithURLCString:(const char *)URLCString;
// Subclasses must override these.
// The "handle" prefix is needed to avoid overriding NSView methods.
- (void)handleMouseMoved:(NSEvent *)event;
- (void)handleMouseEntered:(NSEvent *)event;
- (void)handleMouseExited:(NSEvent *)event;
- (void)setAttributeKeys:(NSArray *)keys andValues:(NSArray *)values;
- (void)focusChanged;
......
......@@ -232,6 +232,16 @@ String WebHaltablePlugin::pluginName() const
ASSERT_NOT_REACHED();
}
- (void)handleMouseEntered:(NSEvent *)event
{
ASSERT_NOT_REACHED();
}
- (void)handleMouseExited:(NSEvent *)event
{
ASSERT_NOT_REACHED();
}
- (void)focusChanged
{
ASSERT_NOT_REACHED();
......
......@@ -143,6 +143,9 @@ typedef union PluginPort {
- (void)didCallPlugInFunction;
- (void)handleMouseMoved:(NSEvent *)event;
- (void)handleMouseEntered:(NSEvent *)event;
- (void)handleMouseExited:(NSEvent *)event;
- (uint32)checkIfAllowedToLoadURL:(const char*)urlCString frame:(const char*)frameNameCString callbackFunc:(void (*)(NPP npp, uint32 checkID, NPBool allowed, void* context))callbackFunc context:(void*)context;
- (void)cancelCheckIfAllowedToLoadURL:(uint32)checkID;
......
......@@ -749,7 +749,7 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
_eventHandler->mouseUp(theEvent);
}
- (void)mouseEntered:(NSEvent *)theEvent
- (void)handleMouseEntered:(NSEvent *)theEvent
{
if (!_isStarted)
return;
......@@ -757,7 +757,7 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
_eventHandler->mouseEntered(theEvent);
}
- (void)mouseExited:(NSEvent *)theEvent
- (void)handleMouseExited:(NSEvent *)theEvent
{
if (!_isStarted)
return;
......@@ -769,8 +769,6 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
[[NSCursor arrowCursor] set];
}
// We can't name this method mouseMoved because we don't want to override
// the NSView mouseMoved implementation.
- (void)handleMouseMoved:(NSEvent *)theEvent
{
if (!_isStarted)
......
......@@ -1493,6 +1493,10 @@ public:
NSEvent* currentNSEvent = frame->eventHandler()->currentNSEvent();
if (event->type() == eventNames().mousemoveEvent)
[(WebBaseNetscapePluginView *)platformWidget() handleMouseMoved:currentNSEvent];
else if (event->type() == eventNames().mouseoverEvent)
[(WebBaseNetscapePluginView *)platformWidget() handleMouseEntered:currentNSEvent];
else if (event->type() == eventNames().mouseoutEvent)
[(WebBaseNetscapePluginView *)platformWidget() handleMouseExited:currentNSEvent];
}
};
......
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