[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:37:48 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 97eadee25641cbe3764a9f9986e394206c100e09
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Apr 18 16:20:14 2003 +0000
WebKit:
Fixed: 3139385 - don't accept drags from other frames in the same WebView
Reviewed by john.
* WebView.subproj/WebFrameView.m: moved drag destination code from WebFrameView to WebView
(-[WebFrameView initWithFrame:]): removed drag registration code
* WebView.subproj/WebFrameViewPrivate.h:
* WebView.subproj/WebFrameViewPrivate.m:
* WebView.subproj/WebHTMLView.m:
(-[WebHTMLView dragImage:at:offset:event:pasteboard:source:slideBack:]): unregister drag types on the WebView
(-[WebHTMLView draggedImage:endedAt:operation:]): reregister drag types on the WebView
* WebView.subproj/WebImageView.m:
(-[WebImageView mouseDragged:]): unregister drag types on the WebView
(-[WebImageView draggedImage:endedAt:operation:]): reregister drag types on the WebView
* WebView.subproj/WebView.m: moved drag destination code from WebFrameView to WebView
(-[WebView draggingEntered:]): moved from WebFrameView
(-[WebView prepareForDragOperation:]): ditto
(-[WebView performDragOperation:]): ditto
(-[WebView concludeDragOperation:]): ditto
* WebView.subproj/WebViewPrivate.h:
* WebView.subproj/WebViewPrivate.m:
(-[WebView _registerDraggedTypes]): ditto
WebBrowser:
- Fixed regression. Don't append "txt" to files that already end in "txt". Doh!
Reviewed by john.
* BrowserDocument.m:
(-[BrowserDocument panel:userEnteredFilename:confirmed:]):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4140 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 1eaef19..08cd19a 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,28 @@
+2003-04-18 Chris Blumenberg <cblu at apple.com>
+
+ Fixed: 3139385 - don't accept drags from other frames in the same WebView
+
+ Reviewed by john.
+
+ * WebView.subproj/WebFrameView.m: moved drag destination code from WebFrameView to WebView
+ (-[WebFrameView initWithFrame:]): removed drag registration code
+ * WebView.subproj/WebFrameViewPrivate.h:
+ * WebView.subproj/WebFrameViewPrivate.m:
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView dragImage:at:offset:event:pasteboard:source:slideBack:]): unregister drag types on the WebView
+ (-[WebHTMLView draggedImage:endedAt:operation:]): reregister drag types on the WebView
+ * WebView.subproj/WebImageView.m:
+ (-[WebImageView mouseDragged:]): unregister drag types on the WebView
+ (-[WebImageView draggedImage:endedAt:operation:]): reregister drag types on the WebView
+ * WebView.subproj/WebView.m: moved drag destination code from WebFrameView to WebView
+ (-[WebView draggingEntered:]): moved from WebFrameView
+ (-[WebView prepareForDragOperation:]): ditto
+ (-[WebView performDragOperation:]): ditto
+ (-[WebView concludeDragOperation:]): ditto
+ * WebView.subproj/WebViewPrivate.h:
+ * WebView.subproj/WebViewPrivate.m:
+ (-[WebView _registerDraggedTypes]): ditto
+
2003-04-17 John Sullivan <sullivan at apple.com>
Reviewed by Maciej.
diff --git a/WebKit/WebView.subproj/WebFrameView.m b/WebKit/WebView.subproj/WebFrameView.m
index a2251c0..298a18b 100644
--- a/WebKit/WebView.subproj/WebFrameView.m
+++ b/WebKit/WebView.subproj/WebFrameView.m
@@ -55,8 +55,6 @@ enum {
[scrollView setHasHorizontalScroller: NO];
[scrollView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
[self addSubview: scrollView];
-
- [self _reregisterDraggedTypes];
++WebFrameViewCount;
@@ -104,36 +102,6 @@ enum {
return [[self documentView] isKindOfClass:[WebHTMLView class]];
}
-- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
-{
- if([[sender draggingPasteboard] _web_bestURL]){
- return NSDragOperationCopy;
- }
-
- return NSDragOperationNone;
-}
-
-- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
-{
- return YES;
-}
-
-- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
-{
- return YES;
-}
-
-- (void)concludeDragOperation:(id <NSDraggingInfo>)sender
-{
- NSURL *URL = [[sender draggingPasteboard] _web_bestURL];
-
- if (URL) {
- NSURLRequest *request = [[NSURLRequest alloc] initWithURL:URL];
- [[[self _controller] mainFrame] loadRequest:request];
- [request release];
- }
-}
-
-(BOOL)acceptsFirstResponder
{
return YES;
diff --git a/WebKit/WebView.subproj/WebFrameViewInternal.h b/WebKit/WebView.subproj/WebFrameViewInternal.h
index 71c0f95..1ddf8e6 100644
--- a/WebKit/WebView.subproj/WebFrameViewInternal.h
+++ b/WebKit/WebView.subproj/WebFrameViewInternal.h
@@ -49,5 +49,4 @@
+ (NSMutableDictionary *)_viewTypes;
+ (Class)_viewClassForMIMEType:(NSString *)MIMEType;
- (BOOL)_isMainFrame;
-- (void)_reregisterDraggedTypes;
@end
diff --git a/WebKit/WebView.subproj/WebFrameViewPrivate.h b/WebKit/WebView.subproj/WebFrameViewPrivate.h
index 71c0f95..1ddf8e6 100644
--- a/WebKit/WebView.subproj/WebFrameViewPrivate.h
+++ b/WebKit/WebView.subproj/WebFrameViewPrivate.h
@@ -49,5 +49,4 @@
+ (NSMutableDictionary *)_viewTypes;
+ (Class)_viewClassForMIMEType:(NSString *)MIMEType;
- (BOOL)_isMainFrame;
-- (void)_reregisterDraggedTypes;
@end
diff --git a/WebKit/WebView.subproj/WebFrameViewPrivate.m b/WebKit/WebView.subproj/WebFrameViewPrivate.m
index 83cea00..de67602 100644
--- a/WebKit/WebView.subproj/WebFrameViewPrivate.m
+++ b/WebKit/WebView.subproj/WebFrameViewPrivate.m
@@ -9,7 +9,6 @@
#import <WebKit/WebDynamicScrollBarsView.h>
#import <WebKit/WebHTMLView.h>
#import <WebKit/WebImageView.h>
-#import <WebKit/WebNSPasteboardExtras.h>
#import <WebKit/WebTextView.h>
#import <WebKit/WebViewPrivate.h>
@@ -302,9 +301,4 @@
return [_private->controller mainFrame] == [self webFrame];
}
-- (void)_reregisterDraggedTypes
-{
- [self registerForDraggedTypes:[NSPasteboard _web_dragTypesForURL]];
-}
-
@end
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index afc8045..f016b44 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -633,7 +633,7 @@
slideBack:(BOOL)slideBack
{
// Don't allow drags to be accepted by this WebFrameView.
- [[self _web_parentWebFrameView] unregisterDraggedTypes];
+ [[self _webView] unregisterDraggedTypes];
// Retain this view during the drag because it may be released before the drag ends.
[self retain];
@@ -670,7 +670,7 @@
[self mouseUp:fakeEvent]; // This will also update the mouseover state.
// Reregister for drag types because they were unregistered before the drag.
- [[self _web_parentWebFrameView] _reregisterDraggedTypes];
+ [[self _webView] _registerDraggedTypes];
// 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 a04e503..50c4137 100644
--- a/WebKit/WebView.subproj/WebImageView.m
+++ b/WebKit/WebView.subproj/WebImageView.m
@@ -162,17 +162,17 @@
- (void)mouseDragged:(NSEvent *)event
{
// Don't allow drags to be accepted by this WebFrameView.
- [[self _web_parentWebFrameView] unregisterDraggedTypes];
+ [[[self _web_parentWebFrameView] _controller] unregisterDraggedTypes];
// Retain this view during the drag because it may be released before the drag ends.
[self retain];
-
+
[self _web_dragPromisedImage:[representation image]
rect:[self bounds]
- URL:[representation URL]
+ URL:[representation URL]
fileType:[[[representation URL] path] pathExtension]
- title:nil
- event:event];
+ title:nil
+ event:event];
}
- (NSArray *)namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination
@@ -192,7 +192,7 @@
- (void)draggedImage:(NSImage *)anImage endedAt:(NSPoint)aPoint operation:(NSDragOperation)operation
{
// Reregister for drag types because they were unregistered before the drag.
- [[self _web_parentWebFrameView] _reregisterDraggedTypes];
+ [[[self _web_parentWebFrameView] _controller] _registerDraggedTypes];
// Balance the previous retain from when the drag started.
[self release];
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index d2bb5d7..67b1465 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -19,6 +19,7 @@
#import <WebKit/WebHTMLView.h>
#import <WebKit/WebKitErrors.h>
#import <WebKit/WebKitStatisticsPrivate.h>
+#import <WebKit/WebNSPasteboardExtras.h>
#import <WebKit/WebNSViewExtras.h>
#import <WebKit/WebPluginDatabase.h>
#import <WebKit/WebPolicyDelegate.h>
@@ -119,6 +120,7 @@ NSString *WebElementLinkTitleKey = @"WebElementLinkTitle";
[self addSubview: wv];
[self _commonInitialization: wv frameName:frameName groupName:groupName];
[wv release];
+ [self _registerDraggedTypes];
return self;
}
@@ -463,7 +465,38 @@ NSString *WebElementLinkTitleKey = @"WebElementLinkTitle";
return _private->hostWindow;
}
--(BOOL)acceptsFirstResponder
+
+- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
+{
+ if([[sender draggingPasteboard] _web_bestURL]){
+ return NSDragOperationCopy;
+ }
+
+ return NSDragOperationNone;
+}
+
+- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
+{
+ return YES;
+}
+
+- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
+{
+ return YES;
+}
+
+- (void)concludeDragOperation:(id <NSDraggingInfo>)sender
+{
+ NSURL *URL = [[sender draggingPasteboard] _web_bestURL];
+
+ if (URL) {
+ NSURLRequest *request = [[NSURLRequest alloc] initWithURL:URL];
+ [[self mainFrame] loadRequest:request];
+ [request release];
+ }
+}
+
+- (BOOL)acceptsFirstResponder
{
return YES;
}
diff --git a/WebKit/WebView.subproj/WebViewPrivate.h b/WebKit/WebView.subproj/WebViewPrivate.h
index 24de03a..0b278eb 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.h
+++ b/WebKit/WebView.subproj/WebViewPrivate.h
@@ -167,6 +167,8 @@ Could be worth adding to the API.
- _policyDelegateForwarder;
- _contextMenuDelegateForwarder;
- _windowOperationsDelegateForwarder;
+
+- (void)_registerDraggedTypes;
@end
@interface _WebSafeForwarder : NSObject
diff --git a/WebKit/WebView.subproj/WebViewPrivate.m b/WebKit/WebView.subproj/WebViewPrivate.m
index 98554f9..8191569 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.m
+++ b/WebKit/WebView.subproj/WebViewPrivate.m
@@ -18,6 +18,7 @@
#import <WebKit/WebFrameViewPrivate.h>
#import <WebKit/WebHistoryItemPrivate.h>
#import <WebKit/WebLocationChangeDelegate.h>
+#import <WebKit/WebNSPasteboardExtras.h>
#import <WebKit/WebPreferencesPrivate.h>
#import <WebKit/WebResourceLoadDelegate.h>
#import <WebKit/WebStandardPanelsPrivate.h>
@@ -575,6 +576,11 @@
return [self _frameForView: aView fromFrame: frame];
}
+- (void)_registerDraggedTypes
+{
+ [self registerForDraggedTypes:[NSPasteboard _web_dragTypesForURL]];
+}
+
@end
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list