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


The following commit has been merged in the debian/unstable branch:
commit 7c27c3f280486ede3c268a06c132c5e5c1ba05d4
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jan 31 17:38:53 2003 +0000

    WebCore:
    
    	Fixed : 3155148 - image shown when dragging gets size from image file, not size as used on page
    
    
            Reviewed by darin.
    
            * kwq/WebCoreBridge.h: added WebCoreElementImageRectKey
            * kwq/WebCoreBridge.mm:
            (-[WebCoreBridge elementAtPoint:]): get the rect of the image
    
    WebKit:
    
    	Fixed : 3155148 - image shown when dragging gets size from image file, not size as used on page
    
            Reviewed by darin.
    
            * Misc.subproj/WebNSViewExtras.h:
            * Misc.subproj/WebNSViewExtras.m:
            (-[NSView _web_dragPromisedImage:rect:URL:fileType:title:event:]): take a rect so we know the original size and origin
            * WebKit.exp: added WebElementImageRectKey
            * WebView.subproj/WebController.h: WebElementImageRectKey
            * WebView.subproj/WebController.m: WebElementImageRectKey
            * WebView.subproj/WebHTMLViewPrivate.m:
            (-[WebHTMLView _handleMouseDragged:]): call _web_dragPromisedImage with WebElementImageRect
            * WebView.subproj/WebImageView.m:
            (-[WebImageView menuForEvent:]): provide the WebElementImageRect since we do this for other image elements
            (-[WebImageView mouseDragged:]): call _web_dragPromisedImage with [self bounds]
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3523 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 7588d33..eac73c4 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,14 @@
+2003-01-31  Chris Blumenberg  <cblu at apple.com>
+
+	Fixed : 3155148 - image shown when dragging gets size from image file, not size as used on page
+
+
+        Reviewed by darin.
+
+        * kwq/WebCoreBridge.h: added WebCoreElementImageRectKey
+        * kwq/WebCoreBridge.mm:
+        (-[WebCoreBridge elementAtPoint:]): get the rect of the image
+
 2003-01-30  Trey Matteson  <trey at apple.com>
 
 	3161088 - disabled select elements are not disabled when scrolling list used	
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 7588d33..eac73c4 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,14 @@
+2003-01-31  Chris Blumenberg  <cblu at apple.com>
+
+	Fixed : 3155148 - image shown when dragging gets size from image file, not size as used on page
+
+
+        Reviewed by darin.
+
+        * kwq/WebCoreBridge.h: added WebCoreElementImageRectKey
+        * kwq/WebCoreBridge.mm:
+        (-[WebCoreBridge elementAtPoint:]): get the rect of the image
+
 2003-01-30  Trey Matteson  <trey at apple.com>
 
 	3161088 - disabled select elements are not disabled when scrolling list used	
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index b730b81..45ea77c 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -60,7 +60,7 @@ typedef khtml::RenderPart KHTMLRenderPart;
 extern NSString *WebCoreElementFrameKey;
 extern NSString *WebCoreElementImageAltStringKey;
 extern NSString *WebCoreElementImageKey;
-extern NSString *WebCoreElementImageLocationKey;
+extern NSString *WebCoreElementImageRectKey;
 extern NSString *WebCoreElementImageURLKey;
 extern NSString *WebCoreElementIsSelectedTextKey;
 extern NSString *WebCoreElementLinkURLKey;
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index 44053bf..82b2a8b 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -72,7 +72,7 @@ using KParts::URLArgs;
 NSString *WebCoreElementFrameKey = 		@"WebElementFrame";
 NSString *WebCoreElementImageAltStringKey = 	@"WebElementImageAltString";
 NSString *WebCoreElementImageKey = 		@"WebElementImage";
-NSString *WebCoreElementImageLocationKey = 	@"WebElementImageLocation";
+NSString *WebCoreElementImageRectKey = 		@"WebElementImageRect";
 NSString *WebCoreElementImageURLKey = 		@"WebElementImageURL";
 NSString *WebCoreElementIsSelectedTextKey = 	@"WebElementIsSelectedTextKey";
 NSString *WebCoreElementLinkURLKey = 		@"WebElementLinkURL";
@@ -501,13 +501,17 @@ static bool initializedObjectCacheSize = FALSE;
         }
         
         RenderImage *r = (RenderImage *)node->renderer();
-        id <WebCoreImageRenderer> image = r->pixmap().image();
-        if (image) {
-            [element setObject:image forKey:WebCoreElementImageKey];
-        }
-        int x, y;
-        if (r->absolutePosition(x, y)) {
-            [element setObject:[NSValue valueWithPoint:NSMakePoint(x,y)] forKey:WebCoreElementImageLocationKey];
+        if (r) {
+            int x, y;
+            if (r->absolutePosition(x, y)) {
+                NSValue *rect = [NSValue valueWithRect:NSMakeRect(x, y, r->contentWidth(), r->contentHeight())];
+                [element setObject:rect forKey:WebCoreElementImageRectKey];
+            }
+            
+            NSImage *image = r->pixmap().image();
+            if (image) {
+                [element setObject:image forKey:WebCoreElementImageKey];
+            }
         }
     }
     
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index c296c93..d4aedbe 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,21 @@
+2003-01-31  Chris Blumenberg  <cblu at apple.com>
+
+	Fixed : 3155148 - image shown when dragging gets size from image file, not size as used on page
+
+        Reviewed by darin.
+
+        * Misc.subproj/WebNSViewExtras.h:
+        * Misc.subproj/WebNSViewExtras.m:
+        (-[NSView _web_dragPromisedImage:rect:URL:fileType:title:event:]): take a rect so we know the original size and origin
+        * WebKit.exp: added WebElementImageRectKey
+        * WebView.subproj/WebController.h: WebElementImageRectKey
+        * WebView.subproj/WebController.m: WebElementImageRectKey
+        * WebView.subproj/WebHTMLViewPrivate.m:
+        (-[WebHTMLView _handleMouseDragged:]): call _web_dragPromisedImage with WebElementImageRect
+        * WebView.subproj/WebImageView.m: 
+        (-[WebImageView menuForEvent:]): provide the WebElementImageRect since we do this for other image elements
+        (-[WebImageView mouseDragged:]): call _web_dragPromisedImage with [self bounds]
+
 === Safari-55 ===
 
 2003-01-30  Chris Blumenberg  <cblu at apple.com>
diff --git a/WebKit/Misc.subproj/WebNSViewExtras.h b/WebKit/Misc.subproj/WebNSViewExtras.h
index 37f9205..051ddcc 100644
--- a/WebKit/Misc.subproj/WebNSViewExtras.h
+++ b/WebKit/Misc.subproj/WebNSViewExtras.h
@@ -36,7 +36,7 @@
 
 // Resizes and applies alpha to image, extends pboard and sets drag origins for dragging promised image files.
 - (void)_web_dragPromisedImage:(NSImage *)image
-                        origin:(NSPoint)origin
+                          rect:(NSRect)rect
                            URL:(NSURL *)URL
                       fileType:(NSString *)fileType
                          title:(NSString *)title
diff --git a/WebKit/Misc.subproj/WebNSViewExtras.m b/WebKit/Misc.subproj/WebNSViewExtras.m
index c60b5f4..486cefc 100644
--- a/WebKit/Misc.subproj/WebNSViewExtras.m
+++ b/WebKit/Misc.subproj/WebNSViewExtras.m
@@ -165,15 +165,19 @@
 #endif
 
 - (void)_web_dragPromisedImage:(NSImage *)image
-                        origin:(NSPoint)origin
+                          rect:(NSRect)rect
                            URL:(NSURL *)URL
                       fileType:(NSString *)fileType
                          title:(NSString *)title
                          event:(NSEvent *)event
-{
-    NSImage *dragImage = [[image copy] autorelease];
+{    
+    NSSize originalSize = rect.size;
+    NSPoint origin = rect.origin;
     
-    NSSize originalSize = [dragImage size];
+    NSImage *dragImage = [[image copy] autorelease];
+    [dragImage setScalesWhenResized:YES];
+    [dragImage setSize:originalSize];
+
     [dragImage _web_scaleToMaxSize:WebMaxDragImageSize];
     NSSize newSize = [dragImage size];
 
diff --git a/WebKit/WebKit.exp b/WebKit/WebKit.exp
index 63baf57..193f23d 100644
--- a/WebKit/WebKit.exp
+++ b/WebKit/WebKit.exp
@@ -40,6 +40,7 @@ _WebBookmarksWereAddedNotification
 _WebBookmarksWereRemovedNotification
 _WebElementFrameKey
 _WebElementImageKey
+_WebElementImageRectKey
 _WebElementImageURLKey
 _WebElementIsSelectedTextKey
 _WebElementLinkLabelKey
diff --git a/WebKit/WebView.subproj/WebController.h b/WebKit/WebView.subproj/WebController.h
index 8f8f07c..5d3d941 100644
--- a/WebKit/WebView.subproj/WebController.h
+++ b/WebKit/WebView.subproj/WebController.h
@@ -30,7 +30,7 @@
 extern NSString *WebElementFrameKey;		// WebFrame of the element
 extern NSString *WebElementImageAltStringKey;	// NSString of the ALT attribute of the image element
 extern NSString *WebElementImageKey;		// NSImage of the image element
-extern NSString *WebElementImageLocationKey;	// NSValue of an NSPoint representing the origin of the image element
+extern NSString *WebElementImageRectKey;	// NSValue of an NSRect, the rect of the image element
 extern NSString *WebElementImageURLKey;		// NSURL of the image element
 extern NSString *WebElementIsSelectedTextKey; 	// NSNumber of BOOL indicating whether the element is selected text or not 
 extern NSString *WebElementLinkURLKey;		// NSURL if the element is within an anchor
diff --git a/WebKit/WebView.subproj/WebController.m b/WebKit/WebView.subproj/WebController.m
index a019f62..58616d7 100644
--- a/WebKit/WebView.subproj/WebController.m
+++ b/WebKit/WebView.subproj/WebController.m
@@ -42,7 +42,7 @@ static const struct UserAgentSpoofTableEntry *_web_findSpoofTableEntry(const cha
 NSString *WebElementFrameKey = 			@"WebElementFrame";
 NSString *WebElementImageKey = 			@"WebElementImage";
 NSString *WebElementImageAltStringKey = 	@"WebElementImageAltString";
-NSString *WebElementImageLocationKey = 		@"WebElementImageLocation";
+NSString *WebElementImageRectKey = 		@"WebElementImageRect";
 NSString *WebElementImageURLKey = 		@"WebElementImageURL";
 NSString *WebElementIsSelectedTextKey = 	@"WebElementIsSelectedTextKey";
 NSString *WebElementLinkURLKey = 		@"WebElementLinkURL";
diff --git a/WebKit/WebView.subproj/WebHTMLViewPrivate.m b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
index 457245b..a625230 100644
--- a/WebKit/WebView.subproj/WebHTMLViewPrivate.m
+++ b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
@@ -496,7 +496,7 @@ static BOOL forceRealHitTest = NO;
     if (imageURL) {
 	_private->draggingImageURL = [imageURL retain];
         [self _web_dragPromisedImage:[element objectForKey:WebElementImageKey]
-                              origin:[[element objectForKey:WebElementImageLocationKey] pointValue]
+                                rect:[[element objectForKey:WebElementImageRectKey] rectValue]
                                  URL:linkURL ? linkURL : imageURL
                             fileType:[[imageURL path] pathExtension]
                                title:[element objectForKey:WebElementImageAltStringKey]
diff --git a/WebKit/WebView.subproj/WebImageView.m b/WebKit/WebView.subproj/WebImageView.m
index 7a9e69f..c34d924 100644
--- a/WebKit/WebView.subproj/WebImageView.m
+++ b/WebKit/WebView.subproj/WebImageView.m
@@ -158,10 +158,11 @@
     ASSERT(controller);
     
     NSDictionary *element = [NSDictionary dictionaryWithObjectsAndKeys:
-        [representation image], WebElementImageKey,
-        [representation URL], WebElementImageURLKey,
-        [NSNumber numberWithBool:NO], WebElementIsSelectedTextKey,
-        frame, WebElementFrameKey, nil];
+        [representation image], 		WebElementImageKey,
+        [NSValue valueWithRect:[self bounds]], 	WebElementImageRectKey,
+        [representation URL], 			WebElementImageURLKey,
+        [NSNumber numberWithBool:NO], 		WebElementIsSelectedTextKey,
+        frame, 					WebElementFrameKey, nil];
         
     return [controller _menuForElement:element];
 }
@@ -176,7 +177,7 @@
         [self retain];
         
         [self _web_dragPromisedImage:[representation image]
-                              origin:NSZeroPoint
+                                rect:[self bounds]
                                  URL:[representation URL]
                             fileType:[[[representation URL] path] pathExtension]
                                title:nil
diff --git a/WebKit/WebView.subproj/WebView.h b/WebKit/WebView.subproj/WebView.h
index 8f8f07c..5d3d941 100644
--- a/WebKit/WebView.subproj/WebView.h
+++ b/WebKit/WebView.subproj/WebView.h
@@ -30,7 +30,7 @@
 extern NSString *WebElementFrameKey;		// WebFrame of the element
 extern NSString *WebElementImageAltStringKey;	// NSString of the ALT attribute of the image element
 extern NSString *WebElementImageKey;		// NSImage of the image element
-extern NSString *WebElementImageLocationKey;	// NSValue of an NSPoint representing the origin of the image element
+extern NSString *WebElementImageRectKey;	// NSValue of an NSRect, the rect of the image element
 extern NSString *WebElementImageURLKey;		// NSURL of the image element
 extern NSString *WebElementIsSelectedTextKey; 	// NSNumber of BOOL indicating whether the element is selected text or not 
 extern NSString *WebElementLinkURLKey;		// NSURL if the element is within an anchor
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index a019f62..58616d7 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -42,7 +42,7 @@ static const struct UserAgentSpoofTableEntry *_web_findSpoofTableEntry(const cha
 NSString *WebElementFrameKey = 			@"WebElementFrame";
 NSString *WebElementImageKey = 			@"WebElementImage";
 NSString *WebElementImageAltStringKey = 	@"WebElementImageAltString";
-NSString *WebElementImageLocationKey = 		@"WebElementImageLocation";
+NSString *WebElementImageRectKey = 		@"WebElementImageRect";
 NSString *WebElementImageURLKey = 		@"WebElementImageURL";
 NSString *WebElementIsSelectedTextKey = 	@"WebElementIsSelectedTextKey";
 NSString *WebElementLinkURLKey = 		@"WebElementLinkURL";

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list