WebCore:
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 3 May 2008 00:44:21 +0000 (00:44 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 3 May 2008 00:44:21 +0000 (00:44 +0000)
2008-05-02  Anders Carlsson  <andersca@apple.com>

        Reviewed by Mark.

        Turns out calling locationInWindow on keyboard events will not throw an exception,
        but the point returned is completely bogus, so remove coordinates from the keyboard event struct.

        * bridge/npapi.h:
        (_NPCocoaEvent::):

WebKit/mac:

2008-05-02  Anders Carlsson  <andersca@apple.com>

        Reviewed by Mark.

        Various Cocoa event model and 64-bit plug-in fixes.

        * Plugins/WebNetscapePluginEventHandlerCocoa.mm:
        (WebNetscapePluginEventHandlerCocoa::sendMouseEvent):
        Set click count.

        (WebNetscapePluginEventHandlerCocoa::flagsChanged):
        (WebNetscapePluginEventHandlerCocoa::sendKeyEvent):
        Don't try to get the mouse location for keyboard events.

        * Plugins/WebPluginPackage.m:
        (-[WebPluginPackage initWithPath:]):
        Preflight the bundle so we won't show 32-bit WebKit plug-ins when running as 64-bit.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@32830 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/bridge/npapi.h
WebKit/mac/ChangeLog
WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.mm
WebKit/mac/Plugins/WebPluginPackage.m

index 6ff7d82..7ed61a7 100644 (file)
@@ -1,3 +1,13 @@
+2008-05-02  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Mark.
+
+        Turns out calling locationInWindow on keyboard events will not throw an exception,
+        but the point returned is completely bogus, so remove coordinates from the keyboard event struct.
+        
+        * bridge/npapi.h:
+        (_NPCocoaEvent::):
+
 2008-05-02  Benjamin Otte  <otte@gnome.org>
 
         Reviewed by Alp Toker.
index eb24fa4..40ba3f8 100644 (file)
@@ -452,8 +452,6 @@ typedef struct _NPCocoaEvent {
         } mouse;
         struct {
             uint32 modifierFlags;
-            double pluginX;
-            double pluginY;            
             NPNSString *characters;
             NPNSString *charactersIgnoringModifiers;
             NPBool isARepeat;
index 34e8fdf..e1e2a9d 100644 (file)
@@ -1,5 +1,23 @@
 2008-05-02  Anders Carlsson  <andersca@apple.com>
 
+        Reviewed by Mark.
+
+        Various Cocoa event model and 64-bit plug-in fixes.
+        
+        * Plugins/WebNetscapePluginEventHandlerCocoa.mm:
+        (WebNetscapePluginEventHandlerCocoa::sendMouseEvent):
+        Set click count.
+        
+        (WebNetscapePluginEventHandlerCocoa::flagsChanged):
+        (WebNetscapePluginEventHandlerCocoa::sendKeyEvent):
+        Don't try to get the mouse location for keyboard events.
+        
+        * Plugins/WebPluginPackage.m:
+        (-[WebPluginPackage initWithPath:]):
+        Preflight the bundle so we won't show 32-bit WebKit plug-ins when running as 64-bit.
+
+2008-05-02  Anders Carlsson  <andersca@apple.com>
+
         Reviewed by Sam.
 
         The event union is now named.
index 1ac01bf..47c5b40 100644 (file)
@@ -88,9 +88,16 @@ bool WebNetscapePluginEventHandlerCocoa::sendMouseEvent(NSEvent *nsEvent, NPCoco
     
     NSPoint point = [m_pluginView convertPoint:[nsEvent locationInWindow] fromView:nil];
     
+    int clickCount;
+    if (type == NPCocoaEventMouseEntered || type == NPCocoaEventMouseExited || type == NPCocoaEventScrollWheel)
+        clickCount = 0;
+    else
+        clickCount = [nsEvent clickCount];
+    
     event.type = type;
     event.event.mouse.modifierFlags = [nsEvent modifierFlags];
     event.event.mouse.buttonNumber = [nsEvent buttonNumber];
+    event.event.mouse.clickCount = clickCount;
     event.event.mouse.pluginX = point.x;
     event.event.mouse.pluginY = point.y;
     event.event.mouse.deltaX = [nsEvent deltaX];
@@ -113,13 +120,9 @@ void WebNetscapePluginEventHandlerCocoa::keyUp(NSEvent *event)
 void WebNetscapePluginEventHandlerCocoa::flagsChanged(NSEvent *nsEvent)
 {
     NPCocoaEvent event;
-    
-    NSPoint point = [m_pluginView convertPoint:[nsEvent locationInWindow] fromView:nil];
-    
+        
     event.type = NPCocoaEventFlagsChanged;
     event.event.key.modifierFlags = [nsEvent modifierFlags];
-    event.event.key.pluginX = point.x;
-    event.event.key.pluginY = point.y;
     event.event.key.keyCode = [nsEvent keyCode];
     event.event.key.isARepeat = false;
     event.event.key.characters = 0;
@@ -131,13 +134,9 @@ void WebNetscapePluginEventHandlerCocoa::flagsChanged(NSEvent *nsEvent)
 void WebNetscapePluginEventHandlerCocoa::sendKeyEvent(NSEvent* nsEvent, NPCocoaEventType type)
 {
     NPCocoaEvent event;
-    
-    NSPoint point = [m_pluginView convertPoint:[nsEvent locationInWindow] fromView:nil];
-    
+        
     event.type = type;
     event.event.key.modifierFlags = [nsEvent modifierFlags];
-    event.event.key.pluginX = point.x;
-    event.event.key.pluginY = point.y;
     event.event.key.keyCode = [nsEvent keyCode];
     event.event.key.isARepeat = [nsEvent isARepeat];
     event.event.key.characters = (NPNSString *)[nsEvent characters];
index d7f144e..f5329b9 100644 (file)
@@ -59,6 +59,7 @@ NSString *WebPlugInContainingElementKey =       @"WebPlugInContainingElementKey"
         }
     }
     
+#ifdef BUILDING_ON_TIGER
     NSFileHandle *executableFile = [NSFileHandle fileHandleForReadingAtPath:[bundle executablePath]];
     NSData *data = [executableFile readDataOfLength:512];
     [executableFile closeFile];
@@ -66,6 +67,12 @@ NSString *WebPlugInContainingElementKey =       @"WebPlugInContainingElementKey"
         [self release];
         return nil;
     }
+#else
+    if (![bundle preflightAndReturnError:nil]) {
+        [self release];
+        return nil;
+    }
+#endif
 
     if (![self getPluginInfoFromPLists]) {
         [self release];