[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

cblu cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:22:00 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit b29a17fb7e6371910f20dfe20428523a375bed04
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jun 27 21:59:02 2002 +0000

            Fixed plug-in positioning.
    
            * Plugins.subproj/IFPluginView.mm:
            (-[IFPluginView
    initWithFrame:plugin:url:baseURL:mime:arguments:]): added some logging.
            (-[IFPluginView setWindow]): Use the window's content view as the
    guide for the port's coordinates. Also added a workaround for Java.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1464 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 5b38810..ade6a70 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,13 @@
+2002-06-27  Chris Blumenberg  <cblu at apple.com>
+
+	Fixed plug-in positioning.
+
+        * Plugins.subproj/IFPluginView.mm:
+        (-[IFPluginView 
+initWithFrame:plugin:url:baseURL:mime:arguments:]): added some logging.
+        (-[IFPluginView setWindow]): Use the window's content view as the 
+guide for the port's coordinates. Also added a workaround for Java.
+
 2002-06-27  Darin Adler  <darin at apple.com>
 
 	Fixed DOM tree viewer.
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 5b38810..ade6a70 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,13 @@
+2002-06-27  Chris Blumenberg  <cblu at apple.com>
+
+	Fixed plug-in positioning.
+
+        * Plugins.subproj/IFPluginView.mm:
+        (-[IFPluginView 
+initWithFrame:plugin:url:baseURL:mime:arguments:]): added some logging.
+        (-[IFPluginView setWindow]): Use the window's content view as the 
+guide for the port's coordinates. Also added a workaround for Java.
+
 2002-06-27  Darin Adler  <darin at apple.com>
 
 	Fixed DOM tree viewer.
diff --git a/WebKit/Plugins.subproj/IFPluginView.mm b/WebKit/Plugins.subproj/IFPluginView.mm
index 545755a..38dd588 100644
--- a/WebKit/Plugins.subproj/IFPluginView.mm
+++ b/WebKit/Plugins.subproj/IFPluginView.mm
@@ -292,6 +292,8 @@ static char *newCString(NSString *string)
     NPP_SetValue = 	[plugin NPP_SetValue];
     NPP_Print = 	[plugin NPP_Print];
 
+    WEBKITDEBUGLEVEL(WEBKIT_LOG_PLUGINS, "%s", [[arguments description] cString]);
+
     // Convert arguments dictionary to 2 string arrays.
     // These arrays are passed to NPP_New, but the strings need to be
     // modifiable and live the entire life of the plugin.
@@ -351,18 +353,27 @@ static char *newCString(NSString *string)
 }
 
 - (void) setWindow
-{
-    NPError npErr;
-    NSRect windowFrame, frameInWindow, visibleRectInWindow;
+{    
     CGrafPtr port = GetWindowPort([[self window] _windowRef]);
-    
-    windowFrame = [[self window] frame];
-    frameInWindow = [self convertRect:[self bounds] toView:nil];
-    visibleRectInWindow = [self convertRect:[self visibleRect] toView:nil];
+    NSRect windowFrame = [[self window] frame];
+    NSRect contentViewFrame = [[[self window] contentView] frame];
+    NSRect frameInWindow = [self convertRect:[self bounds] toView:nil];
+    NSRect visibleRectInWindow = [self convertRect:[self visibleRect] toView:nil];
+    float windowContentFrameHeight, toolbarHeight;
+    NPError npErr;
+        
+    if([mime isEqualToString:@"application/x-java-applet"]){
+        // The java plug-in assumes that the port is positioned 22 pixels down from the top-left corner of the window.
+        // This is incorrect if the window has a toolbar. Here's the workaround. 2973586
+        toolbarHeight = windowFrame.size.height - contentViewFrame.size.height - contentViewFrame.origin.y - 22;
+        windowContentFrameHeight = contentViewFrame.size.height + toolbarHeight;
+    }else{
+        windowContentFrameHeight = contentViewFrame.size.height;
+    }
     
     // flip Y coordinates
-    frameInWindow.origin.y =  windowFrame.size.height - frameInWindow.origin.y - frameInWindow.size.height; 
-    visibleRectInWindow.origin.y =  windowFrame.size.height - visibleRectInWindow.origin.y - visibleRectInWindow.size.height;
+    frameInWindow.origin.y =  windowContentFrameHeight - frameInWindow.origin.y - frameInWindow.size.height; 
+    visibleRectInWindow.origin.y =  windowContentFrameHeight - visibleRectInWindow.origin.y - visibleRectInWindow.size.height;
     
     nPort.port = port;
     
diff --git a/WebKit/Plugins.subproj/WebPluginView.m b/WebKit/Plugins.subproj/WebPluginView.m
index 545755a..38dd588 100644
--- a/WebKit/Plugins.subproj/WebPluginView.m
+++ b/WebKit/Plugins.subproj/WebPluginView.m
@@ -292,6 +292,8 @@ static char *newCString(NSString *string)
     NPP_SetValue = 	[plugin NPP_SetValue];
     NPP_Print = 	[plugin NPP_Print];
 
+    WEBKITDEBUGLEVEL(WEBKIT_LOG_PLUGINS, "%s", [[arguments description] cString]);
+
     // Convert arguments dictionary to 2 string arrays.
     // These arrays are passed to NPP_New, but the strings need to be
     // modifiable and live the entire life of the plugin.
@@ -351,18 +353,27 @@ static char *newCString(NSString *string)
 }
 
 - (void) setWindow
-{
-    NPError npErr;
-    NSRect windowFrame, frameInWindow, visibleRectInWindow;
+{    
     CGrafPtr port = GetWindowPort([[self window] _windowRef]);
-    
-    windowFrame = [[self window] frame];
-    frameInWindow = [self convertRect:[self bounds] toView:nil];
-    visibleRectInWindow = [self convertRect:[self visibleRect] toView:nil];
+    NSRect windowFrame = [[self window] frame];
+    NSRect contentViewFrame = [[[self window] contentView] frame];
+    NSRect frameInWindow = [self convertRect:[self bounds] toView:nil];
+    NSRect visibleRectInWindow = [self convertRect:[self visibleRect] toView:nil];
+    float windowContentFrameHeight, toolbarHeight;
+    NPError npErr;
+        
+    if([mime isEqualToString:@"application/x-java-applet"]){
+        // The java plug-in assumes that the port is positioned 22 pixels down from the top-left corner of the window.
+        // This is incorrect if the window has a toolbar. Here's the workaround. 2973586
+        toolbarHeight = windowFrame.size.height - contentViewFrame.size.height - contentViewFrame.origin.y - 22;
+        windowContentFrameHeight = contentViewFrame.size.height + toolbarHeight;
+    }else{
+        windowContentFrameHeight = contentViewFrame.size.height;
+    }
     
     // flip Y coordinates
-    frameInWindow.origin.y =  windowFrame.size.height - frameInWindow.origin.y - frameInWindow.size.height; 
-    visibleRectInWindow.origin.y =  windowFrame.size.height - visibleRectInWindow.origin.y - visibleRectInWindow.size.height;
+    frameInWindow.origin.y =  windowContentFrameHeight - frameInWindow.origin.y - frameInWindow.size.height; 
+    visibleRectInWindow.origin.y =  windowContentFrameHeight - visibleRectInWindow.origin.y - visibleRectInWindow.size.height;
     
     nPort.port = port;
     

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list