[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 07:43:47 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 1f289269d759c5670b9b9c6b6261eb5b05a8c741
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jun 2 17:56:58 2003 +0000

    	Fixed: <rdar://problem/3154910>: No video when viewing QT plug-in content at some pages but audio works
    
    	This fix works around QT plug-in bug 3275755, but I think the fix is logical and worth keeping even after 3275755 is fixed.
    
    	Eric Carlson:
    	The problem happens when you call NPP_SetWindow with a 0 width or height more than once. The first call to NPP_SetWindow always seems to have width and height set to 0, but the next call sometimes has it set to the correct values (those in the EMBED tag). This is when it draws successfully. It seems to me that the fix is to always pass the correct width and height to NPP_SetWindow. You always position the plug-in far offscreen (1000000, -52) and set the clip region to an empty rect (48576, 52, 48576, 52) so there isn't really any danger of the plug-in drawing anyway. Additionally, you pass the correct width and height in the call to NPP_New before the first call to NPP_SetWindow.
    
            Reviewed by john, darin.
    
            * Plugins.subproj/WebBaseNetscapePluginView.h:
            * Plugins.subproj/WebBaseNetscapePluginView.m:
            (-[WebBaseNetscapePluginView saveAndSetPortStateForUpdate:]): use the NSView width and height if greater than 0, else use the tag specified width and height
            (-[WebBaseNetscapePluginView isNewWindowEqualToOldWindow]): new
            (-[WebBaseNetscapePluginView setWindow]): NPP_SetWindow may be expensive, only call it if it has changed
            * Plugins.subproj/WebNetscapePluginPackage.m:
            (-[WebNetscapePluginPackage launchRealPlayer]): tweak, no need to store error code since it is ignored
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4463 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index d46c471..43d6d53 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,22 @@
+2003-06-02  Chris Blumenberg  <cblu at apple.com>
+
+	Fixed: <rdar://problem/3154910>: No video when viewing QT plug-in content at some pages but audio works
+
+	This fix works around QT plug-in bug 3275755, but I think the fix is logical and worth keeping even after 3275755 is fixed.
+
+	Eric Carlson:
+	The problem happens when you call NPP_SetWindow with a 0 width or height more than once. The first call to NPP_SetWindow always seems to have width and height set to 0, but the next call sometimes has it set to the correct values (those in the EMBED tag). This is when it draws successfully. It seems to me that the fix is to always pass the correct width and height to NPP_SetWindow. You always position the plug-in far offscreen (1000000, -52) and set the clip region to an empty rect (48576, 52, 48576, 52) so there isn't really any danger of the plug-in drawing anyway. Additionally, you pass the correct width and height in the call to NPP_New before the first call to NPP_SetWindow.
+
+        Reviewed by john, darin.
+
+        * Plugins.subproj/WebBaseNetscapePluginView.h:
+        * Plugins.subproj/WebBaseNetscapePluginView.m:
+        (-[WebBaseNetscapePluginView saveAndSetPortStateForUpdate:]): use the NSView width and height if greater than 0, else use the tag specified width and height
+        (-[WebBaseNetscapePluginView isNewWindowEqualToOldWindow]): new
+        (-[WebBaseNetscapePluginView setWindow]): NPP_SetWindow may be expensive, only call it if it has changed
+        * Plugins.subproj/WebNetscapePluginPackage.m:
+        (-[WebNetscapePluginPackage launchRealPlayer]): tweak, no need to store error code since it is ignored
+
 2003-05-30  Richard Williamson  <rjw at apple.com>
 
 	Fixed 3272516.  Items are now expired from the
diff --git a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.h b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.h
index 07a967f..3343584 100644
--- a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.h
+++ b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.h
@@ -26,11 +26,16 @@
         
     NPP instance;
     NPWindow window;
+    NPWindow lastSetWindow;
     NP_Port nPort;
+    NP_Port lastSetPort;
     NPP_t instanceStruct;
 
     BOOL isStarted;
     BOOL inSetWindow;
+
+    int32 specifiedHeight;
+    int32 specifiedWidth;
             
     NSString *MIMEType;
     NSURL *baseURL;
diff --git a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
index c2563be..ee2c975 100644
--- a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
+++ b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
@@ -188,8 +188,8 @@ typedef struct {
     
     window.x = (int32)boundsInWindow.origin.x; 
     window.y = (int32)boundsInWindow.origin.y;
-    window.width = (uint32)boundsInWindow.size.width;
-    window.height = (uint32)boundsInWindow.size.height;
+    window.width = NSWidth(boundsInWindow) > 0 ? NSWidth(boundsInWindow) : specifiedWidth;
+    window.height = NSHeight(boundsInWindow) > 0 ? NSHeight(boundsInWindow) : specifiedHeight;
 
     window.clipRect.top = (uint16)visibleRectInWindow.origin.y;
     window.clipRect.left = (uint16)visibleRectInWindow.origin.x;
@@ -617,6 +617,48 @@ typedef struct {
 
 #pragma mark WEB_NETSCAPE_PLUGIN
 
+- (BOOL)isNewWindowEqualToOldWindow
+{
+    if (window.x != lastSetWindow.x) {
+        return NO;
+    }
+    if (window.y != lastSetWindow.y) {
+        return NO;
+    }
+    if (window.width != lastSetWindow.width) {
+        return NO;
+    }
+    if (window.height != lastSetWindow.height) {
+        return NO;
+    }
+    if (window.clipRect.top != lastSetWindow.clipRect.top) {
+        return NO;
+    }
+    if (window.clipRect.left != lastSetWindow.clipRect.left) {
+        return NO;
+    }
+    if (window.clipRect.bottom  != lastSetWindow.clipRect.bottom ) {
+        return NO;
+    }
+    if (window.clipRect.right != lastSetWindow.clipRect.right) {
+        return NO;
+    }
+    if (window.type != lastSetWindow.type) {
+        return NO;
+    }
+    if (nPort.portx != lastSetPort.portx) {
+        return NO;
+    }
+    if (nPort.porty != lastSetPort.porty) {
+        return NO;
+    }
+    if (nPort.port != lastSetPort.port) {
+        return NO;
+    }
+    
+    return YES;
+}
+
 - (void)setWindow
 {
     if (!isStarted) {
@@ -624,18 +666,25 @@ typedef struct {
     }
     
     PortState portState = [self saveAndSetPortState];
-    
-    // Make sure we don't call NPP_HandleEvent while we're inside NPP_SetWindow.
-    // We probably don't want more general reentrancy protection; we are really
-    // protecting only against this one case, which actually comes up when
-    // you first install the SVG viewer plug-in.
-    NPError npErr;
-    ASSERT(!inSetWindow);
-    inSetWindow = YES;
-    npErr = NPP_SetWindow(instance, &window);
-    inSetWindow = NO;
-    LOG(Plugins, "NPP_SetWindow: %d, port=0x%08x, window.x:%d window.y:%d",
-        npErr, (int)nPort.port, (int)window.x, (int)window.y);
+
+    if (![self isNewWindowEqualToOldWindow]) {        
+        // Make sure we don't call NPP_HandleEvent while we're inside NPP_SetWindow.
+        // We probably don't want more general reentrancy protection; we are really
+        // protecting only against this one case, which actually comes up when
+        // you first install the SVG viewer plug-in.
+        NPError npErr;
+        ASSERT(!inSetWindow);
+        
+        inSetWindow = YES;
+        npErr = NPP_SetWindow(instance, &window);
+        inSetWindow = NO;
+
+        LOG(Plugins, "NPP_SetWindow: %d, port=0x%08x, window.x:%d window.y:%d",
+            npErr, (int)nPort.port, (int)window.x, (int)window.y);
+
+        lastSetWindow = window;
+        lastSetPort = nPort;
+    }
 
     [self restorePortState:portState];
 }
@@ -886,9 +935,16 @@ typedef struct {
     unsigned i;
     unsigned count = [keys count];
     for (i = 0; i < count; i++) {
-        cAttributes[argsCount] = strdup([[keys objectAtIndex:i] UTF8String]);
-        cValues[argsCount] = strdup([[values objectAtIndex:i] UTF8String]);
-        LOG(Plugins, "%@ = %@", [keys objectAtIndex:i], [values objectAtIndex:i]);
+        NSString *key = [keys objectAtIndex:i];
+        NSString *value = [values objectAtIndex:i];
+        if ([key _web_isCaseInsensitiveEqualToString:@"height"]) {
+            specifiedHeight = [value intValue];
+        } else if ([key _web_isCaseInsensitiveEqualToString:@"width"]) {
+            specifiedWidth = [value intValue];
+        }
+        cAttributes[argsCount] = strdup([key UTF8String]);
+        cValues[argsCount] = strdup([value UTF8String]);
+        LOG(Plugins, "%@ = %@", key, value);
         argsCount++;
     }
 }
diff --git a/WebKit/Plugins.subproj/WebNetscapePluginPackage.m b/WebKit/Plugins.subproj/WebNetscapePluginPackage.m
index ab103de..f62d78b 100644
--- a/WebKit/Plugins.subproj/WebNetscapePluginPackage.m
+++ b/WebKit/Plugins.subproj/WebNetscapePluginPackage.m
@@ -339,7 +339,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
         bzero(&URLSpec, sizeof(URLSpec));
         URLSpec.launchFlags = kLSLaunchDefaults | kLSLaunchDontSwitch;
         URLSpec.appURL = appURL;
-        error = LSOpenFromURLSpec(&URLSpec, NULL);
+        LSOpenFromURLSpec(&URLSpec, NULL);
     }
 
     CFRelease(appURL);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list