[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:58 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 5d40ac68658d6274fed3f0e3e795e28595986a30
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jun 3 21:36:10 2003 +0000

    	Fixed: <rdar://problem/3167792>: hang in _web_dragPromisedImage dragging 4 MB image
    
            Reviewed by john.
    
            * Misc.subproj/WebNSViewExtras.m:
            (-[NSView _web_dragPromisedImage:rect:URL:fileType:title:event:]): if the original image is greater than 1500x1500, use a file icon for the drag image to avoid hanging
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4473 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 3afb0ba..2945be5 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,12 @@
+2003-06-03  Chris Blumenberg  <cblu at apple.com>
+
+	Fixed: <rdar://problem/3167792>: hang in _web_dragPromisedImage dragging 4 MB image
+
+        Reviewed by john.
+
+        * Misc.subproj/WebNSViewExtras.m:
+        (-[NSView _web_dragPromisedImage:rect:URL:fileType:title:event:]): if the original image is greater than 1500x1500, use a file icon for the drag image to avoid hanging
+
 2003-06-02  Richard Williamson  <rjw at apple.com>
 
 	Fix for 3250352.
@@ -20,6 +29,7 @@
 
 	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.
 
diff --git a/WebKit/Misc.subproj/WebNSViewExtras.m b/WebKit/Misc.subproj/WebNSViewExtras.m
index f8891ef..e74cd8c 100644
--- a/WebKit/Misc.subproj/WebNSViewExtras.m
+++ b/WebKit/Misc.subproj/WebNSViewExtras.m
@@ -14,6 +14,9 @@
 #define WebDragStartHysteresisX			5.0
 #define WebDragStartHysteresisY			5.0
 #define WebMaxDragImageSize 			NSMakeSize(400, 400)
+#define WebMaxOriginalImageArea			(1500 * 1500)
+#define WebDragIconRightInset			7.0
+#define WebDragIconBottomInset			3.0
 
 #ifdef DEBUG_VIEWS
 @interface NSObject (Foo)
@@ -175,28 +178,38 @@
                       fileType:(NSString *)fileType
                          title:(NSString *)title
                          event:(NSEvent *)event
-{    
-    NSSize originalSize = rect.size;
-    NSPoint origin = rect.origin;
-    
-    NSImage *dragImage = [[image copy] autorelease];
-    [dragImage setScalesWhenResized:YES];
-    [dragImage setSize:originalSize];
-
-    [dragImage _web_scaleToMaxSize:WebMaxDragImageSize];
-    NSSize newSize = [dragImage size];
-
-    [dragImage _web_dissolveToFraction:WebDragImageAlpha];
-
+{
     NSPoint mouseDownPoint = [self convertPoint:[event locationInWindow] fromView:nil];
-    NSPoint currentPoint = [self convertPoint:[[_window currentEvent] locationInWindow] fromView:nil];
-
-    // Properly orient the drag image and orient it differently if it's smaller than the original
-    origin.x = mouseDownPoint.x - (((mouseDownPoint.x - origin.x) / originalSize.width) * newSize.width);
-    origin.y = origin.y + originalSize.height;
-    origin.y = mouseDownPoint.y - (((mouseDownPoint.y - origin.y) / originalSize.height) * newSize.height);
-
-    NSSize offset = NSMakeSize(currentPoint.x - mouseDownPoint.x, currentPoint.y - mouseDownPoint.y);
+    NSImage *dragImage;
+    NSPoint origin;
+    NSSize offset;
+
+    if ([image size].height * [image size].width <= WebMaxOriginalImageArea) {
+        NSSize originalSize = rect.size;
+        origin = rect.origin;
+        
+        dragImage = [[image copy] autorelease];
+        [dragImage setScalesWhenResized:YES];
+        [dragImage setSize:originalSize];
+    
+        [dragImage _web_scaleToMaxSize:WebMaxDragImageSize];
+        NSSize newSize = [dragImage size];
+    
+        [dragImage _web_dissolveToFraction:WebDragImageAlpha];
+    
+        NSPoint currentPoint = [self convertPoint:[[_window currentEvent] locationInWindow] fromView:nil];
+    
+        // Properly orient the drag image and orient it differently if it's smaller than the original
+        origin.x = mouseDownPoint.x - (((mouseDownPoint.x - origin.x) / originalSize.width) * newSize.width);
+        origin.y = origin.y + originalSize.height;
+        origin.y = mouseDownPoint.y - (((mouseDownPoint.y - origin.y) / originalSize.height) * newSize.height);
+    
+        offset = NSMakeSize(currentPoint.x - mouseDownPoint.x, currentPoint.y - mouseDownPoint.y);
+    } else {
+        dragImage = [[NSWorkspace sharedWorkspace] iconForFileType:fileType];
+        offset = NSMakeSize([dragImage size].width - WebDragIconRightInset, -WebDragIconBottomInset);
+        origin = NSMakePoint(mouseDownPoint.x - offset.width, mouseDownPoint.y - offset.height);
+    }
 
     NSArray *filesTypes = [NSArray arrayWithObject:fileType];
     

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list