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


The following commit has been merged in the debian/unstable branch:
commit e57f106e13b13b8dc19a3bc2350bb8f4047a178f
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 11 16:42:49 2002 +0000

    	Fixed: 3118430 - crash / loop trying to copy url of link to clipboard
    	Fixed: 3122585 - REGRESSION: dragging links to the desktop or a Finder window does not do anything
    
            Reviewed by john.
    
    	We were reusing the drag types from the previous drag pasteboard. For example, we would declare image types when dragging URLs. This would confuse the Finder, so location files weren't being created. This would occasional cause us to crash because we weren't providing the declared data.
    
            * Misc.subproj/WebNSPasteboardExtras.h:
            * Misc.subproj/WebNSPasteboardExtras.m:
            (+[NSPasteboard _web_dragTypesForURL]): Added more types that we handle
            (-[NSPasteboard _web_writeURL:andTitle:withOwner:declareTypes:]): declares the provided types, writes URL and title
            (-[NSPasteboard _web_writeURL:andTitle:withOwner:]): call _web_writeURL:andTitle:withOwner:types: with _web_dragTypesForURL
            * Misc.subproj/WebNSViewExtras.h:
            * Misc.subproj/WebNSViewExtras.m:
            (-[NSView _web_dragPromisedImage:origin:URL:fileType:title:event:]): call _web_writeURL:andTitle:withOwner: types: plus images types
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3000 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 5b2d04d..0263323 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,21 @@
+2002-12-11  Chris Blumenberg  <cblu at apple.com>
+
+	Fixed: 3118430 - crash / loop trying to copy url of link to clipboard
+	Fixed: 3122585 - REGRESSION: dragging links to the desktop or a Finder window does not do anything
+
+        Reviewed by john.
+
+	We were reusing the drag types from the previous drag pasteboard. For example, we would declare image types when dragging URLs. This would confuse the Finder, so location files weren't being created. This would occasional cause us to crash because we weren't providing the declared data. 
+
+        * Misc.subproj/WebNSPasteboardExtras.h:
+        * Misc.subproj/WebNSPasteboardExtras.m:
+        (+[NSPasteboard _web_dragTypesForURL]): Added more types that we handle
+        (-[NSPasteboard _web_writeURL:andTitle:withOwner:declareTypes:]): declares the provided types, writes URL and title
+        (-[NSPasteboard _web_writeURL:andTitle:withOwner:]): call _web_writeURL:andTitle:withOwner:types: with _web_dragTypesForURL
+        * Misc.subproj/WebNSViewExtras.h:
+        * Misc.subproj/WebNSViewExtras.m:
+        (-[NSView _web_dragPromisedImage:origin:URL:fileType:title:event:]): call _web_writeURL:andTitle:withOwner: types: plus images types
+
 2002-12-10  Trey Matteson  <trey at apple.com>
 
 	3092966 - going back goes to different page (can't go back to a POST page)
diff --git a/WebKit/Misc.subproj/WebNSPasteboardExtras.h b/WebKit/Misc.subproj/WebNSPasteboardExtras.h
index 7dccaa8..5b864d5 100644
--- a/WebKit/Misc.subproj/WebNSPasteboardExtras.h
+++ b/WebKit/Misc.subproj/WebNSPasteboardExtras.h
@@ -23,5 +23,6 @@ extern NSString *WebURLNamePboardType;
 -(NSURL *)_web_bestURL;
 
 - (void)_web_writeURL:(NSURL *)URL andTitle:(NSString *)title withOwner:(id)owner;
+- (void)_web_writeURL:(NSURL *)URL andTitle:(NSString *)title withOwner:(id)owner types:(NSArray *)types;
 
 @end
diff --git a/WebKit/Misc.subproj/WebNSPasteboardExtras.m b/WebKit/Misc.subproj/WebNSPasteboardExtras.m
index f7bdc1d..22063bd 100644
--- a/WebKit/Misc.subproj/WebNSPasteboardExtras.m
+++ b/WebKit/Misc.subproj/WebNSPasteboardExtras.m
@@ -29,7 +29,13 @@ NSString *WebURLNamePboardType = nil;
 
 + (NSArray *)_web_dragTypesForURL
 {
-    return [NSArray arrayWithObjects:NSURLPboardType, NSStringPboardType, NSFilenamesPboardType, nil];
+    return [NSArray arrayWithObjects:
+        WebURLsWithTitlesPboardType,
+        NSURLPboardType,
+        WebURLPboardType,
+        WebURLNamePboardType,
+        NSStringPboardType,
+        nil];
 }
 
 -(NSURL *)_web_bestURL
@@ -67,51 +73,30 @@ NSString *WebURLNamePboardType = nil;
     return nil;
 }
 
-- (void)_web_writeURL:(NSURL *)URL andTitle:(NSString *)title withOwner:(id)owner
+- (void)_web_writeURL:(NSURL *)URL andTitle:(NSString *)title withOwner:(id)owner types:(NSArray *)types
 {
     ASSERT(URL);
-
-    NSArray *types;
-
-    if(title){
-        types = [NSArray arrayWithObjects:
-            WebURLsWithTitlesPboardType,
-            NSURLPboardType,
-            WebURLPboardType,
-            NSStringPboardType,
-            nil];
-    }else{
-        types = [NSArray arrayWithObjects:
-            WebURLsWithTitlesPboardType,
-            NSURLPboardType,
-            WebURLPboardType,
-            WebURLNamePboardType,
-            NSStringPboardType,
-            nil];
-    }
-    
-    NSArray *originalTypes = [self types];
-    
-    if([originalTypes count] > 0){
-        NSMutableArray *newTypes;
-        newTypes = [originalTypes mutableCopy];
-        [newTypes addObjectsFromArray:types];
-        types = newTypes;
-    }
+    ASSERT(types);
     
     [self declareTypes:types owner:owner];
 
-    [URL writeToPasteboard:self];
-    [self setString:[URL absoluteString] forType:NSStringPboardType];
-
-    NSArray *titles = nil;
-    if(title && ![title isEqualToString:@""]){
-        titles = [NSArray arrayWithObject:title];
-        [self setString:title forType:WebURLNamePboardType];
+    if(!title || [title isEqualToString:@""]){
+        title = [[URL path] lastPathComponent];
+        if(!title || [title isEqualToString:@""]){
+            title = [URL absoluteString];
+        }
     }
     
-    [WebURLsWithTitles writeURLs:[NSArray arrayWithObject:URL] andTitles:titles toPasteboard:self];
+    [URL writeToPasteboard:self];
+    [self setString:title forType:WebURLNamePboardType];
     [self setString:[URL absoluteString] forType:WebURLPboardType];
+    [self setString:[URL absoluteString] forType:NSStringPboardType];
+    [WebURLsWithTitles writeURLs:[NSArray arrayWithObject:URL] andTitles:[NSArray arrayWithObject:title] toPasteboard:self];
+}
+
+- (void)_web_writeURL:(NSURL *)URL andTitle:(NSString *)title withOwner:(id)owner
+{
+    [self _web_writeURL:URL andTitle:title withOwner:owner types:[NSPasteboard _web_dragTypesForURL]];
 }
 
 @end
diff --git a/WebKit/Misc.subproj/WebNSViewExtras.h b/WebKit/Misc.subproj/WebNSViewExtras.h
index 3e46991..0447e52 100644
--- a/WebKit/Misc.subproj/WebNSViewExtras.h
+++ b/WebKit/Misc.subproj/WebNSViewExtras.h
@@ -44,8 +44,3 @@
                          event:(NSEvent *)event;
 
 @end
-
- at interface NSFilePromiseDragSource : NSObject
-- initWithSource:(id)draggingSource;
-- (void)setTypes:(NSArray *)types onPasteboard:(NSPasteboard *)pboard;
- at end
diff --git a/WebKit/Misc.subproj/WebNSViewExtras.m b/WebKit/Misc.subproj/WebNSViewExtras.m
index f20b9a8..5989693 100644
--- a/WebKit/Misc.subproj/WebNSViewExtras.m
+++ b/WebKit/Misc.subproj/WebNSViewExtras.m
@@ -22,6 +22,11 @@
 @end
 #endif
 
+ at interface NSFilePromiseDragSource : NSObject
+- initWithSource:(id)draggingSource;
+- (void)setTypes:(NSArray *)types onPasteboard:(NSPasteboard *)pboard;
+ at end
+
 @implementation NSView (WebExtras)
 
 - (NSView *)_web_superviewOfClass:(Class)class
@@ -186,8 +191,9 @@
     NSArray *filesTypes = [NSArray arrayWithObject:fileType];
     
     NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSDragPboard];
-    [pboard declareTypes:[NSArray arrayWithObjects:NSFilesPromisePboardType, NSTIFFPboardType, nil] owner:self];
-    [pboard _web_writeURL:URL andTitle:title withOwner:self];
+    NSMutableArray *types = [NSMutableArray arrayWithObjects:NSFilesPromisePboardType, NSTIFFPboardType, nil];
+    [types addObjectsFromArray:[NSPasteboard _web_dragTypesForURL]];
+    [pboard _web_writeURL:URL andTitle:title withOwner:self types:types];
     [pboard setPropertyList:filesTypes forType:NSFilesPromisePboardType];
     [pboard setData:[image TIFFRepresentation] forType:NSTIFFPboardType];
     

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list