[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:10:43 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 81e0000852dfac0f63d3ec80578bfbcc37a50dd8
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Dec 3 21:57:11 2002 +0000
Fixed:
3112477 - REGRESSION: dropping image within window loads image in current window
Fix: Unregister the parent webview for dragging when the drag starts, reregister after the drag ends.
3116423 - Dragged images sometimes have the wrong promised-file file type
Fix: Make the - [NSView_web_dragPromisedImage...] method take a file type rather than deriving the file type from the URL
3115768 - REGRESSION: contextual menu item "copy url to clipboard" doesn't work
Fix: In [NSPastboard _web_writeURL:andTitle:withOwner:] adding pboard types doesn't work for the general pasteboard, have to redeclare.
3116594 - Image on the drag pasteboard shouldn't have applied transparency and scaling
Fix: In - [NSView_web_dragPromisedImage...] put the original image on the pboard
Reviewed by John.
* Misc.subproj/WebNSPasteboardExtras.m:
(-[NSPasteboard _web_writeURL:andTitle:withOwner:]): don't use addTypes as it doesn't work as I expected
* Misc.subproj/WebNSViewExtras.h:
* Misc.subproj/WebNSViewExtras.m:
(-[NSView _web_dragPromisedImage:origin:URL:fileType:title:event:]): put the original image on the pboard, not the drag image
* WebView.subproj/WebHTMLView.m:
(-[WebHTMLView dragImage:at:offset:event:pasteboard:source:slideBack:]):
(-[WebHTMLView mouseDragged:]): call _web_dragPromisedImage
(-[WebHTMLView draggedImage:endedAt:operation:]): call -[WebView _reregisterDraggedTypes]
* WebView.subproj/WebImageView.m:
(-[WebImageView mouseDragged:]): call _web_dragPromisedImage
(-[WebImageView draggedImage:endedAt:operation:]): call -[WebView _reregisterDraggedTypes]
* WebView.subproj/WebView.m:
(-[WebView initWithFrame:]): call _reregisterDraggedTypes
(-[WebView draggingEntered:]): simplified, don't need to check drag source
* WebView.subproj/WebViewPrivate.h:
* WebView.subproj/WebViewPrivate.m:
(-[WebView _reregisterDraggedTypes]):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2910 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 447a150..9d6c99f 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,39 @@
+2002-12-03 Chris Blumenberg <cblu at apple.com>
+
+ Fixed:
+ 3112477 - REGRESSION: dropping image within window loads image in current window
+ Fix: Unregister the parent webview for dragging when the drag starts, reregister after the drag ends.
+
+ 3116423 - Dragged images sometimes have the wrong promised-file file type
+ Fix: Make the - [NSView_web_dragPromisedImage...] method take a file type rather than deriving the file type from the URL
+
+ 3115768 - REGRESSION: contextual menu item "copy url to clipboard" doesn't work
+ Fix: In [NSPastboard _web_writeURL:andTitle:withOwner:] adding pboard types doesn't work for the general pasteboard, have to redeclare.
+
+ 3116594 - Image on the drag pasteboard shouldn't have applied transparency and scaling
+ Fix: In - [NSView_web_dragPromisedImage...] put the original image on the pboard
+
+ Reviewed by John.
+
+ * Misc.subproj/WebNSPasteboardExtras.m:
+ (-[NSPasteboard _web_writeURL:andTitle:withOwner:]): don't use addTypes as it doesn't work as I expected
+ * Misc.subproj/WebNSViewExtras.h:
+ * Misc.subproj/WebNSViewExtras.m:
+ (-[NSView _web_dragPromisedImage:origin:URL:fileType:title:event:]): put the original image on the pboard, not the drag image
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView dragImage:at:offset:event:pasteboard:source:slideBack:]):
+ (-[WebHTMLView mouseDragged:]): call _web_dragPromisedImage
+ (-[WebHTMLView draggedImage:endedAt:operation:]): call -[WebView _reregisterDraggedTypes]
+ * WebView.subproj/WebImageView.m:
+ (-[WebImageView mouseDragged:]): call _web_dragPromisedImage
+ (-[WebImageView draggedImage:endedAt:operation:]): call -[WebView _reregisterDraggedTypes]
+ * WebView.subproj/WebView.m:
+ (-[WebView initWithFrame:]): call _reregisterDraggedTypes
+ (-[WebView draggingEntered:]): simplified, don't need to check drag source
+ * WebView.subproj/WebViewPrivate.h:
+ * WebView.subproj/WebViewPrivate.m:
+ (-[WebView _reregisterDraggedTypes]):
+
2002-12-03 Darin Adler <darin at apple.com>
- fixed 3114796 -- WORLD LEAKS: 1 WebFrame leaked on trivial source file with <html> tag only
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 447a150..9d6c99f 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,39 @@
+2002-12-03 Chris Blumenberg <cblu at apple.com>
+
+ Fixed:
+ 3112477 - REGRESSION: dropping image within window loads image in current window
+ Fix: Unregister the parent webview for dragging when the drag starts, reregister after the drag ends.
+
+ 3116423 - Dragged images sometimes have the wrong promised-file file type
+ Fix: Make the - [NSView_web_dragPromisedImage...] method take a file type rather than deriving the file type from the URL
+
+ 3115768 - REGRESSION: contextual menu item "copy url to clipboard" doesn't work
+ Fix: In [NSPastboard _web_writeURL:andTitle:withOwner:] adding pboard types doesn't work for the general pasteboard, have to redeclare.
+
+ 3116594 - Image on the drag pasteboard shouldn't have applied transparency and scaling
+ Fix: In - [NSView_web_dragPromisedImage...] put the original image on the pboard
+
+ Reviewed by John.
+
+ * Misc.subproj/WebNSPasteboardExtras.m:
+ (-[NSPasteboard _web_writeURL:andTitle:withOwner:]): don't use addTypes as it doesn't work as I expected
+ * Misc.subproj/WebNSViewExtras.h:
+ * Misc.subproj/WebNSViewExtras.m:
+ (-[NSView _web_dragPromisedImage:origin:URL:fileType:title:event:]): put the original image on the pboard, not the drag image
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView dragImage:at:offset:event:pasteboard:source:slideBack:]):
+ (-[WebHTMLView mouseDragged:]): call _web_dragPromisedImage
+ (-[WebHTMLView draggedImage:endedAt:operation:]): call -[WebView _reregisterDraggedTypes]
+ * WebView.subproj/WebImageView.m:
+ (-[WebImageView mouseDragged:]): call _web_dragPromisedImage
+ (-[WebImageView draggedImage:endedAt:operation:]): call -[WebView _reregisterDraggedTypes]
+ * WebView.subproj/WebView.m:
+ (-[WebView initWithFrame:]): call _reregisterDraggedTypes
+ (-[WebView draggingEntered:]): simplified, don't need to check drag source
+ * WebView.subproj/WebViewPrivate.h:
+ * WebView.subproj/WebViewPrivate.m:
+ (-[WebView _reregisterDraggedTypes]):
+
2002-12-03 Darin Adler <darin at apple.com>
- fixed 3114796 -- WORLD LEAKS: 1 WebFrame leaked on trivial source file with <html> tag only
diff --git a/WebKit/Misc.subproj/WebNSPasteboardExtras.m b/WebKit/Misc.subproj/WebNSPasteboardExtras.m
index 745213f..f7bdc1d 100644
--- a/WebKit/Misc.subproj/WebNSPasteboardExtras.m
+++ b/WebKit/Misc.subproj/WebNSPasteboardExtras.m
@@ -70,13 +70,36 @@ NSString *WebURLNamePboardType = nil;
- (void)_web_writeURL:(NSURL *)URL andTitle:(NSString *)title withOwner:(id)owner
{
ASSERT(URL);
-
- NSArray *types = [NSArray arrayWithObjects:WebURLsWithTitlesPboardType, NSURLPboardType, NSStringPboardType, nil];
- if([self types] && [[self types] count] > 0){
- [self addTypes:types owner:owner];
+
+ NSArray *types;
+
+ if(title){
+ types = [NSArray arrayWithObjects:
+ WebURLsWithTitlesPboardType,
+ NSURLPboardType,
+ WebURLPboardType,
+ NSStringPboardType,
+ nil];
}else{
- [self declareTypes:types owner:owner];
+ 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;
+ }
+
+ [self declareTypes:types owner:owner];
[URL writeToPasteboard:self];
[self setString:[URL absoluteString] forType:NSStringPboardType];
diff --git a/WebKit/Misc.subproj/WebNSViewExtras.h b/WebKit/Misc.subproj/WebNSViewExtras.h
index 7f41a62..3e46991 100644
--- a/WebKit/Misc.subproj/WebNSViewExtras.h
+++ b/WebKit/Misc.subproj/WebNSViewExtras.h
@@ -37,8 +37,9 @@
// Resizes and applies alpha to image, extends pboard and sets drag origins for dragging promised image files.
- (void)_web_dragPromisedImage:(NSImage *)image
- fromOrigin:(NSPoint)origin
- withURL:(NSURL *)URL
+ origin:(NSPoint)origin
+ URL:(NSURL *)URL
+ fileType:(NSString *)fileType
title:(NSString *)title
event:(NSEvent *)event;
@@ -48,10 +49,3 @@
- initWithSource:(id)draggingSource;
- (void)setTypes:(NSArray *)types onPasteboard:(NSPasteboard *)pboard;
@end
-
- at interface WebFilePromiseDragSource : NSFilePromiseDragSource
-{
- id _draggingSource;
-}
-- (id)draggingSource;
- at end;
diff --git a/WebKit/Misc.subproj/WebNSViewExtras.m b/WebKit/Misc.subproj/WebNSViewExtras.m
index 850ce97..f20b9a8 100644
--- a/WebKit/Misc.subproj/WebNSViewExtras.m
+++ b/WebKit/Misc.subproj/WebNSViewExtras.m
@@ -159,18 +159,19 @@
#endif
- (void)_web_dragPromisedImage:(NSImage *)image
- fromOrigin:(NSPoint)origin
- withURL:(NSURL *)URL
+ origin:(NSPoint)origin
+ URL:(NSURL *)URL
+ fileType:(NSString *)fileType
title:(NSString *)title
event:(NSEvent *)event
{
- image = [[image copy] autorelease];
+ NSImage *dragImage = [[image copy] autorelease];
- NSSize originalSize = [image size];
- [image _web_scaleToMaxSize:WebMaxDragImageSize];
- NSSize newSize = [image size];
+ NSSize originalSize = [dragImage size];
+ [dragImage _web_scaleToMaxSize:WebMaxDragImageSize];
+ NSSize newSize = [dragImage size];
- [image _web_dissolveToFraction:WebDragImageAlpha];
+ [dragImage _web_dissolveToFraction:WebDragImageAlpha];
NSPoint mouseDownPoint = [self convertPoint:[event locationInWindow] fromView:nil];
NSPoint currentPoint = [self convertPoint:[[_window currentEvent] locationInWindow] fromView:nil];
@@ -182,39 +183,18 @@
NSSize offset = NSMakeSize(currentPoint.x - mouseDownPoint.x, currentPoint.y - mouseDownPoint.y);
- NSArray *filesTypes = [NSArray arrayWithObject:[[URL path] pathExtension]];
+ 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];
[pboard setPropertyList:filesTypes forType:NSFilesPromisePboardType];
[pboard setData:[image TIFFRepresentation] forType:NSTIFFPboardType];
- [pboard _web_writeURL:URL andTitle:title withOwner:self];
-
+
id source = [[NSFilePromiseDragSource alloc] initWithSource:(id)self];
[source setTypes:filesTypes onPasteboard:pboard];
- [self dragImage:image at:origin offset:offset event:event pasteboard:pboard source:source slideBack:YES];
+ [self dragImage:dragImage at:origin offset:offset event:event pasteboard:pboard source:source slideBack:YES];
}
@end
-
- at implementation WebFilePromiseDragSource
-
-- initWithSource:(id)draggingSource
-{
- [super initWithSource:draggingSource];
- _draggingSource = draggingSource;
- return self;
-}
-
-- (id)draggingSource
-{
- return _draggingSource;
-}
-
-- (void)dealloc
-{
- //[super dealloc];
-}
-
- at end;
\ No newline at end of file
diff --git a/WebKit/WebView.subproj/WebFrameView.m b/WebKit/WebView.subproj/WebFrameView.m
index 9a683c2..71ec9bf 100644
--- a/WebKit/WebView.subproj/WebFrameView.m
+++ b/WebKit/WebView.subproj/WebFrameView.m
@@ -97,8 +97,8 @@ NSString *WebErrorDomainWebKit = @"WebErrorDomainWebKit";
[scrollView setHasHorizontalScroller: NO];
[scrollView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
[self addSubview: scrollView];
-
- [self registerForDraggedTypes:[NSPasteboard _web_dragTypesForURL]];
+
+ [self _reregisterDraggedTypes];
++WebViewCount;
@@ -148,13 +148,7 @@ NSString *WebErrorDomainWebKit = @"WebErrorDomainWebKit";
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
{
- id draggingSource = [sender draggingSource];
- if([draggingSource isKindOfClass:[WebFilePromiseDragSource class]]){
- draggingSource = [draggingSource draggingSource];
- }
-
- if([[sender draggingPasteboard] _web_bestURL] &&
- (![self documentView] || (draggingSource != [self documentView]))){
+ if([[sender draggingPasteboard] _web_bestURL]){
return NSDragOperationCopy;
}
diff --git a/WebKit/WebView.subproj/WebFrameViewInternal.h b/WebKit/WebView.subproj/WebFrameViewInternal.h
index b1eefd0..1b0b8d5 100644
--- a/WebKit/WebView.subproj/WebFrameViewInternal.h
+++ b/WebKit/WebView.subproj/WebFrameViewInternal.h
@@ -49,4 +49,5 @@
+ (NSMutableDictionary *)_viewTypes;
+ (BOOL)_canShowMIMEType:(NSString *)MIMEType;
- (BOOL)_isMainFrame;
+- (void)_reregisterDraggedTypes;
@end
diff --git a/WebKit/WebView.subproj/WebFrameViewPrivate.h b/WebKit/WebView.subproj/WebFrameViewPrivate.h
index b1eefd0..1b0b8d5 100644
--- a/WebKit/WebView.subproj/WebFrameViewPrivate.h
+++ b/WebKit/WebView.subproj/WebFrameViewPrivate.h
@@ -49,4 +49,5 @@
+ (NSMutableDictionary *)_viewTypes;
+ (BOOL)_canShowMIMEType:(NSString *)MIMEType;
- (BOOL)_isMainFrame;
+- (void)_reregisterDraggedTypes;
@end
diff --git a/WebKit/WebView.subproj/WebFrameViewPrivate.m b/WebKit/WebView.subproj/WebFrameViewPrivate.m
index edc8aff..83de588 100644
--- a/WebKit/WebView.subproj/WebFrameViewPrivate.m
+++ b/WebKit/WebView.subproj/WebFrameViewPrivate.m
@@ -15,6 +15,7 @@
#import <WebKit/WebControllerPrivate.h>
#import <WebKit/WebHTMLView.h>
#import <WebKit/WebImageView.h>
+#import <WebKit/WebNSPasteboardExtras.h>
#import <WebKit/WebTextView.h>
#import <WebFoundation/WebNSDictionaryExtras.h>
@@ -271,4 +272,9 @@
return [_private->controller mainFrame] == [_private->controller frameForView:self];
}
+- (void)_reregisterDraggedTypes
+{
+ [self registerForDraggedTypes:[NSPasteboard _web_dragTypesForURL]];
+}
+
@end
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index 4eea986..e9446fa 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -598,6 +598,23 @@
[[self _bridge] mouseDown:event];
}
+- (void)dragImage:(NSImage *)dragImage
+ at:(NSPoint)at
+ offset:(NSSize)offset
+ event:(NSEvent *)event
+ pasteboard:(NSPasteboard *)pasteboard
+ source:(id)source
+ slideBack:(BOOL)slideBack
+{
+ // Don't allow drags to be accepted by this WebView.
+ [[self _web_parentWebView] unregisterDraggedTypes];
+
+ // Retain this view during the drag because it may be released before the drag ends.
+ [self retain];
+
+ [super dragImage:dragImage at:at offset:offset event:event pasteboard:pasteboard source:source slideBack:slideBack];
+}
+
- (void)mouseDragged:(NSEvent *)event
{
// If the frame has a provisional data source, this view may be released.
@@ -632,13 +649,11 @@
if (imageURL){
_private->draggingImageElement = [element retain];
-
- // Retain this view during the drag because it may be released before the drag ends.
- [self retain];
[self _web_dragPromisedImage:[element objectForKey:WebElementImageKey]
- fromOrigin:[[element objectForKey:WebElementImageLocationKey] pointValue]
- withURL:linkURL ? linkURL : imageURL
+ origin:[[element objectForKey:WebElementImageLocationKey] pointValue]
+ URL:linkURL ? linkURL : imageURL
+ fileType:[[imageURL path] pathExtension]
title:[element objectForKey:WebElementImageAltStringKey]
event:_private->mouseDownEvent];
}else if (linkURL) {
@@ -725,8 +740,6 @@
NSSize centerOffset = NSMakeSize(imageSize.width / 2, -DRAG_LABEL_BORDER_Y);
NSPoint imagePoint = NSMakePoint(mousePoint.x - centerOffset.width, mousePoint.y - centerOffset.height);
- // Retain this view during the drag because it may be released before the drag ends.
- [self retain];
[self dragImage:dragImage
at:imagePoint
offset:centerOffset
@@ -758,6 +771,9 @@
// So after the drag we need to explicitly update the mouseover state.
[self _updateMouseoverWithEvent:[NSApp currentEvent]];
+ // Reregister for drag types because they were unregistered before the drag.
+ [[self _web_parentWebView] _reregisterDraggedTypes];
+
// Balance the previous retain from when the drag started.
[self release];
}
diff --git a/WebKit/WebView.subproj/WebImageView.m b/WebKit/WebView.subproj/WebImageView.m
index 0fea9e2..e3bafc0 100644
--- a/WebKit/WebView.subproj/WebImageView.m
+++ b/WebKit/WebView.subproj/WebImageView.m
@@ -13,6 +13,7 @@
#import <WebKit/WebImageRepresentation.h>
#import <WebKit/WebNSViewExtras.h>
#import <WebKit/WebView.h>
+#import <WebKit/WebViewPrivate.h>
@implementation WebImageView
@@ -161,12 +162,16 @@
- (void)mouseDragged:(NSEvent *)event
{
if(acceptsDrags){
+ // Don't allow drags to be accepted by this WebView.
+ [[self _web_parentWebView] unregisterDraggedTypes];
+
// Retain this view during the drag because it may be released before the drag ends.
[self retain];
[self _web_dragPromisedImage:[representation image]
- fromOrigin:NSZeroPoint
- withURL:[representation URL]
+ origin:NSZeroPoint
+ URL:[representation URL]
+ fileType:[[[representation URL] path] pathExtension]
title:nil
event:event];
}
@@ -185,6 +190,9 @@
- (void)draggedImage:(NSImage *)anImage endedAt:(NSPoint)aPoint operation:(NSDragOperation)operation
{
+ // Reregister for drag types because they were unregistered before the drag.
+ [[self _web_parentWebView] _reregisterDraggedTypes];
+
// Balance the previous retain from when the drag started.
[self release];
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list