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

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


The following commit has been merged in the debian/unstable branch:
commit 980914a4aec7d3f86f61e46170935a6e21451949
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jul 2 15:12:09 2002 +0000

    	- fixed 2975790 - Ads on salon.com scribble all over page
    
            * Plugins.subproj/IFPluginView.mm:
            (-[IFPluginView setUpWindowAndPort]): New, sets up the window, but does not
    	call NPP_SetWindow again.
            (-[IFPluginView setWindow]): Call [setUpWindowAndPort] then call NPP_SetWindow.
            (-[IFPluginView start]): Register for changes to the bounds or frame of any of
    	our superviews, not just one particular one. Also, don't bother to register for
    	notification when the window resizes. Finally, use the constants for the names
    	of the notifications, not literal strings.
            (-[IFPluginView layout]): Just use [setUpWindowAndPort]; no need for a new call
    	to NPP_SetWindow.
            (-[IFPluginView viewHasMoved:]): Just use [setUpWindowAndPort]; no need for a new
    	call to NPP_SetWindow.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1490 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 7fa8905..2c95af4 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,20 @@
+2002-07-02  Darin Adler  <darin at apple.com>
+
+	- fixed 2975790 - Ads on salon.com scribble all over page
+
+        * Plugins.subproj/IFPluginView.mm:
+        (-[IFPluginView setUpWindowAndPort]): New, sets up the window, but does not
+	call NPP_SetWindow again.
+        (-[IFPluginView setWindow]): Call [setUpWindowAndPort] then call NPP_SetWindow.
+        (-[IFPluginView start]): Register for changes to the bounds or frame of any of
+	our superviews, not just one particular one. Also, don't bother to register for
+	notification when the window resizes. Finally, use the constants for the names
+	of the notifications, not literal strings.
+        (-[IFPluginView layout]): Just use [setUpWindowAndPort]; no need for a new call
+	to NPP_SetWindow.
+        (-[IFPluginView viewHasMoved:]): Just use [setUpWindowAndPort]; no need for a new
+	call to NPP_SetWindow.
+
 2002-07-01  Maciej Stachowiak  <mjs at apple.com>
 
         * WebView.subproj/IFWebView.mm:
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 7fa8905..2c95af4 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,20 @@
+2002-07-02  Darin Adler  <darin at apple.com>
+
+	- fixed 2975790 - Ads on salon.com scribble all over page
+
+        * Plugins.subproj/IFPluginView.mm:
+        (-[IFPluginView setUpWindowAndPort]): New, sets up the window, but does not
+	call NPP_SetWindow again.
+        (-[IFPluginView setWindow]): Call [setUpWindowAndPort] then call NPP_SetWindow.
+        (-[IFPluginView start]): Register for changes to the bounds or frame of any of
+	our superviews, not just one particular one. Also, don't bother to register for
+	notification when the window resizes. Finally, use the constants for the names
+	of the notifications, not literal strings.
+        (-[IFPluginView layout]): Just use [setUpWindowAndPort]; no need for a new call
+	to NPP_SetWindow.
+        (-[IFPluginView viewHasMoved:]): Just use [setUpWindowAndPort]; no need for a new
+	call to NPP_SetWindow.
+
 2002-07-01  Maciej Stachowiak  <mjs at apple.com>
 
         * WebView.subproj/IFWebView.mm:
diff --git a/WebKit/Plugins.subproj/IFPluginView.mm b/WebKit/Plugins.subproj/IFPluginView.mm
index 0fff8e7..0af49ee 100644
--- a/WebKit/Plugins.subproj/IFPluginView.mm
+++ b/WebKit/Plugins.subproj/IFPluginView.mm
@@ -352,41 +352,41 @@ static char *newCString(NSString *string)
     [super dealloc];
 }
 
-- (void) setWindow
-{    
+- (void)setUpWindowAndPort
+{
     CGrafPtr port = GetWindowPort([[self window] _windowRef]);
     NSRect windowFrame = [[self window] frame];
     NSRect contentViewFrame = [[[self window] contentView] frame];
-    NSRect frameInWindow = [self convertRect:[self bounds] toView:nil];
+    NSRect boundsInWindow = [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"]){
+    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{
+    } else {
         windowContentFrameHeight = contentViewFrame.size.height;
     }
     
     // flip Y coordinates
-    frameInWindow.origin.y =  windowContentFrameHeight - frameInWindow.origin.y - frameInWindow.size.height; 
-    visibleRectInWindow.origin.y =  windowContentFrameHeight - visibleRectInWindow.origin.y - visibleRectInWindow.size.height;
+    boundsInWindow.origin.y = windowContentFrameHeight - boundsInWindow.origin.y - boundsInWindow.size.height; 
+    visibleRectInWindow.origin.y = windowContentFrameHeight - visibleRectInWindow.origin.y - visibleRectInWindow.size.height;
     
     nPort.port = port;
     
     // FIXME: Are these values correct? Without them, Flash freaks.
-    nPort.portx = -(int32)frameInWindow.origin.x;
-    nPort.porty = -(int32)frameInWindow.origin.y;   
+    nPort.portx = -(int32)boundsInWindow.origin.x;
+    nPort.porty = -(int32)boundsInWindow.origin.y;
+    
     window.window = &nPort;
     
-    window.x = (int32)frameInWindow.origin.x; 
-    window.y = (int32)frameInWindow.origin.y;
+    window.x = (int32)boundsInWindow.origin.x; 
+    window.y = (int32)boundsInWindow.origin.y;
 
-    window.width = (uint32)frameInWindow.size.width;
-    window.height = (uint32)frameInWindow.size.height;
+    window.width = (uint32)boundsInWindow.size.width;
+    window.height = (uint32)boundsInWindow.size.height;
 
     window.clipRect.top = (uint16)visibleRectInWindow.origin.y;
     window.clipRect.left = (uint16)visibleRectInWindow.origin.x;
@@ -394,14 +394,18 @@ static char *newCString(NSString *string)
     window.clipRect.right = (uint16)(visibleRectInWindow.origin.x + visibleRectInWindow.size.width);
     
     window.type = NPWindowTypeWindow;
-    
-    npErr = NPP_SetWindow(instance, &window);
+}
+
+- (void) setWindow
+{
+    [self setUpWindowAndPort];
+
+    NPError npErr = NPP_SetWindow(instance, &window);
     WEBKITDEBUGLEVEL(WEBKIT_LOG_PLUGINS, "NPP_SetWindow: %d, port=0x%08x\n", npErr, (int)nPort.port);
 
-    // Draw test    
 #if 0
+    // Draw test    
     Rect portRect;
-
     GetPortBounds(port, &portRect);
     SetPort(port);
     MoveTo(0,0);
@@ -431,23 +435,25 @@ static char *newCString(NSString *string)
     
     theWindow = [self window];
     notificationCenter = [NSNotificationCenter defaultCenter];
-    [notificationCenter addObserver:self selector:@selector(viewHasMoved:) 
-        name:@"NSViewBoundsDidChangeNotification" object:[self _IF_superviewWithName:@"NSClipView"]];
-    [notificationCenter addObserver:self selector:@selector(viewHasMoved:) 
-        name:@"NSWindowDidResizeNotification" object:theWindow];
+    for (NSView *view = self; view; view = [view superview]) {
+        [notificationCenter addObserver:self selector:@selector(viewHasMoved:) 
+            name:NSViewFrameDidChangeNotification object:view];
+        [notificationCenter addObserver:self selector:@selector(viewHasMoved:) 
+            name:NSViewBoundsDidChangeNotification object:view];
+    }
     [notificationCenter addObserver:self selector:@selector(windowWillClose:) 
-        name:@"NSWindowWillCloseNotification" object:theWindow];
+        name:NSWindowWillCloseNotification object:theWindow];
     [notificationCenter addObserver:self selector:@selector(windowBecameKey:) 
-        name:@"NSWindowDidBecomeKeyNotification" object:theWindow];
+        name:NSWindowDidBecomeKeyNotification object:theWindow];
     [notificationCenter addObserver:self selector:@selector(windowResignedKey:) 
-        name:@"NSWindowDidResignKeyNotification" object:theWindow];
+        name:NSWindowDidResignKeyNotification object:theWindow];
     [notificationCenter addObserver:self selector:@selector(defaultsHaveChanged:) 
-        name:@"NSUserDefaultsDidChangeNotification" object:nil];
+        name:NSUserDefaultsDidChangeNotification object:nil];
     
     if ([theWindow isKeyWindow])
         [self sendActivateEvent:YES];
     
-    id webView = [self _IF_superviewWithName:@"IFWebView"];
+    IFWebView *webView = [self _IF_superviewWithName:@"IFWebView"];
     webController = [[webView controller] retain];
     webFrame = 	    [[webController frameForView:webView] retain];
     webDataSource = [[webFrame dataSource] retain];
@@ -475,7 +481,7 @@ static char *newCString(NSString *string)
     isStarted = NO;
 
     [self removeTrackingRect:trackingTag];
-            
+    
     // Stop any active streams
     [streams makeObjectsPerformSelector:@selector(stop)];
     
@@ -574,7 +580,7 @@ static char *newCString(NSString *string)
     
     [self setFrame:NSMakeRect(0, 0, superFrame.size.width, superFrame.size.height)];
     [self setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
-    [self setWindow];
+    [self setUpWindowAndPort];
 }
 
 
@@ -603,10 +609,9 @@ static char *newCString(NSString *string)
 
 #pragma mark NOTIFICATIONS
 
--(void) viewHasMoved:(NSNotification *)notification
+-(void)viewHasMoved:(NSNotification *)notification
 {
-    [self sendUpdateEvent]; 
-    [self setWindow];
+    [self setUpWindowAndPort];
 
     // reset the tracking rect
     [self removeTrackingRect:trackingTag];
diff --git a/WebKit/Plugins.subproj/WebPluginView.m b/WebKit/Plugins.subproj/WebPluginView.m
index 0fff8e7..0af49ee 100644
--- a/WebKit/Plugins.subproj/WebPluginView.m
+++ b/WebKit/Plugins.subproj/WebPluginView.m
@@ -352,41 +352,41 @@ static char *newCString(NSString *string)
     [super dealloc];
 }
 
-- (void) setWindow
-{    
+- (void)setUpWindowAndPort
+{
     CGrafPtr port = GetWindowPort([[self window] _windowRef]);
     NSRect windowFrame = [[self window] frame];
     NSRect contentViewFrame = [[[self window] contentView] frame];
-    NSRect frameInWindow = [self convertRect:[self bounds] toView:nil];
+    NSRect boundsInWindow = [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"]){
+    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{
+    } else {
         windowContentFrameHeight = contentViewFrame.size.height;
     }
     
     // flip Y coordinates
-    frameInWindow.origin.y =  windowContentFrameHeight - frameInWindow.origin.y - frameInWindow.size.height; 
-    visibleRectInWindow.origin.y =  windowContentFrameHeight - visibleRectInWindow.origin.y - visibleRectInWindow.size.height;
+    boundsInWindow.origin.y = windowContentFrameHeight - boundsInWindow.origin.y - boundsInWindow.size.height; 
+    visibleRectInWindow.origin.y = windowContentFrameHeight - visibleRectInWindow.origin.y - visibleRectInWindow.size.height;
     
     nPort.port = port;
     
     // FIXME: Are these values correct? Without them, Flash freaks.
-    nPort.portx = -(int32)frameInWindow.origin.x;
-    nPort.porty = -(int32)frameInWindow.origin.y;   
+    nPort.portx = -(int32)boundsInWindow.origin.x;
+    nPort.porty = -(int32)boundsInWindow.origin.y;
+    
     window.window = &nPort;
     
-    window.x = (int32)frameInWindow.origin.x; 
-    window.y = (int32)frameInWindow.origin.y;
+    window.x = (int32)boundsInWindow.origin.x; 
+    window.y = (int32)boundsInWindow.origin.y;
 
-    window.width = (uint32)frameInWindow.size.width;
-    window.height = (uint32)frameInWindow.size.height;
+    window.width = (uint32)boundsInWindow.size.width;
+    window.height = (uint32)boundsInWindow.size.height;
 
     window.clipRect.top = (uint16)visibleRectInWindow.origin.y;
     window.clipRect.left = (uint16)visibleRectInWindow.origin.x;
@@ -394,14 +394,18 @@ static char *newCString(NSString *string)
     window.clipRect.right = (uint16)(visibleRectInWindow.origin.x + visibleRectInWindow.size.width);
     
     window.type = NPWindowTypeWindow;
-    
-    npErr = NPP_SetWindow(instance, &window);
+}
+
+- (void) setWindow
+{
+    [self setUpWindowAndPort];
+
+    NPError npErr = NPP_SetWindow(instance, &window);
     WEBKITDEBUGLEVEL(WEBKIT_LOG_PLUGINS, "NPP_SetWindow: %d, port=0x%08x\n", npErr, (int)nPort.port);
 
-    // Draw test    
 #if 0
+    // Draw test    
     Rect portRect;
-
     GetPortBounds(port, &portRect);
     SetPort(port);
     MoveTo(0,0);
@@ -431,23 +435,25 @@ static char *newCString(NSString *string)
     
     theWindow = [self window];
     notificationCenter = [NSNotificationCenter defaultCenter];
-    [notificationCenter addObserver:self selector:@selector(viewHasMoved:) 
-        name:@"NSViewBoundsDidChangeNotification" object:[self _IF_superviewWithName:@"NSClipView"]];
-    [notificationCenter addObserver:self selector:@selector(viewHasMoved:) 
-        name:@"NSWindowDidResizeNotification" object:theWindow];
+    for (NSView *view = self; view; view = [view superview]) {
+        [notificationCenter addObserver:self selector:@selector(viewHasMoved:) 
+            name:NSViewFrameDidChangeNotification object:view];
+        [notificationCenter addObserver:self selector:@selector(viewHasMoved:) 
+            name:NSViewBoundsDidChangeNotification object:view];
+    }
     [notificationCenter addObserver:self selector:@selector(windowWillClose:) 
-        name:@"NSWindowWillCloseNotification" object:theWindow];
+        name:NSWindowWillCloseNotification object:theWindow];
     [notificationCenter addObserver:self selector:@selector(windowBecameKey:) 
-        name:@"NSWindowDidBecomeKeyNotification" object:theWindow];
+        name:NSWindowDidBecomeKeyNotification object:theWindow];
     [notificationCenter addObserver:self selector:@selector(windowResignedKey:) 
-        name:@"NSWindowDidResignKeyNotification" object:theWindow];
+        name:NSWindowDidResignKeyNotification object:theWindow];
     [notificationCenter addObserver:self selector:@selector(defaultsHaveChanged:) 
-        name:@"NSUserDefaultsDidChangeNotification" object:nil];
+        name:NSUserDefaultsDidChangeNotification object:nil];
     
     if ([theWindow isKeyWindow])
         [self sendActivateEvent:YES];
     
-    id webView = [self _IF_superviewWithName:@"IFWebView"];
+    IFWebView *webView = [self _IF_superviewWithName:@"IFWebView"];
     webController = [[webView controller] retain];
     webFrame = 	    [[webController frameForView:webView] retain];
     webDataSource = [[webFrame dataSource] retain];
@@ -475,7 +481,7 @@ static char *newCString(NSString *string)
     isStarted = NO;
 
     [self removeTrackingRect:trackingTag];
-            
+    
     // Stop any active streams
     [streams makeObjectsPerformSelector:@selector(stop)];
     
@@ -574,7 +580,7 @@ static char *newCString(NSString *string)
     
     [self setFrame:NSMakeRect(0, 0, superFrame.size.width, superFrame.size.height)];
     [self setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
-    [self setWindow];
+    [self setUpWindowAndPort];
 }
 
 
@@ -603,10 +609,9 @@ static char *newCString(NSString *string)
 
 #pragma mark NOTIFICATIONS
 
--(void) viewHasMoved:(NSNotification *)notification
+-(void)viewHasMoved:(NSNotification *)notification
 {
-    [self sendUpdateEvent]; 
-    [self setWindow];
+    [self setUpWindowAndPort];
 
     // reset the tracking rect
     [self removeTrackingRect:trackingTag];

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list