[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 08:42:02 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 00002a0e6ead1ee2a8566df010aae68890b6caa1
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu May 27 01:02:40 2004 +0000

    	Added and implemented proposed dragging API changes. These changes are necessary to make JS dragging work properly.
    
            Reviewed by trey.
    
            * WebView.subproj/WebDefaultUIDelegate.m:
            (-[WebDefaultUIDelegate webView:shouldDetermineDragOperationForDraggingInfo:dragOperation:]): instead of calling back to the WebView to get the default drag operation, return YES. Return NO in order to return a custom drag operation. Removed element parameter since another new API provides a way to get that.
            (-[WebDefaultUIDelegate webView:shouldProcessDragWithDraggingInfo:]): Removed element parameter since another new API provides a way to get that.
            * WebView.subproj/WebDocumentInternal.h:
            * WebView.subproj/WebHTMLView.m:
            (-[WebHTMLView draggingUpdatedWithDraggingInfo:]): now returns a drag operation
            (-[WebHTMLView draggingCancelledWithDraggingInfo:]): moved
            * WebView.subproj/WebUIDelegatePrivate.h:
            * WebView.subproj/WebView.m:
            (-[WebView elementAtPoint:]): new proposed API
            (-[WebView dragOperationForDraggingInfo:]): removed code from this API that should be removed
            (-[WebView _dragOperationForDraggingInfo:]): call new API
            (-[WebView concludeDragOperation:]): call new API
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6695 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index f81ad0c..94c2c6a 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,23 @@
+2004-05-26  Chris Blumenberg  <cblu at apple.com>
+
+	Added and implemented proposed dragging API changes. These changes are necessary to make JS dragging work properly.
+
+        Reviewed by trey.
+
+        * WebView.subproj/WebDefaultUIDelegate.m:
+        (-[WebDefaultUIDelegate webView:shouldDetermineDragOperationForDraggingInfo:dragOperation:]): instead of calling back to the WebView to get the default drag operation, return YES. Return NO in order to return a custom drag operation. Removed element parameter since another new API provides a way to get that.
+        (-[WebDefaultUIDelegate webView:shouldProcessDragWithDraggingInfo:]): Removed element parameter since another new API provides a way to get that.
+        * WebView.subproj/WebDocumentInternal.h:
+        * WebView.subproj/WebHTMLView.m:
+        (-[WebHTMLView draggingUpdatedWithDraggingInfo:]): now returns a drag operation
+        (-[WebHTMLView draggingCancelledWithDraggingInfo:]): moved
+        * WebView.subproj/WebUIDelegatePrivate.h:
+        * WebView.subproj/WebView.m:
+        (-[WebView elementAtPoint:]): new proposed API
+        (-[WebView dragOperationForDraggingInfo:]): removed code from this API that should be removed
+        (-[WebView _dragOperationForDraggingInfo:]): call new API
+        (-[WebView concludeDragOperation:]): call new API
+
 2004-05-26  Darin Adler  <darin at apple.com>
 
         Reviewed by John.
diff --git a/WebKit/WebView.subproj/WebDefaultUIDelegate.m b/WebKit/WebView.subproj/WebDefaultUIDelegate.m
index d758147..d908328 100644
--- a/WebKit/WebView.subproj/WebDefaultUIDelegate.m
+++ b/WebKit/WebView.subproj/WebDefaultUIDelegate.m
@@ -173,12 +173,12 @@ static WebDefaultUIDelegate *sharedDelegate = nil;
     return YES;
 }
 
-- (NSDragOperation)webView:(WebView *)webView dragOperationForDraggingInfo:(id <NSDraggingInfo>)draggingInfo overElement:(NSDictionary *)element
+- (BOOL)webView:(WebView *)webView shouldDetermineDragOperationForDraggingInfo:(id <NSDraggingInfo>)draggingInfo dragOperation:(NSDragOperation *)dragOperation
 {
-    return [webView dragOperationForDraggingInfo:draggingInfo];
+    return YES;
 }
 
-- (BOOL)webView:(WebView *)webView shouldProcessDragWithDraggingInfo:(id <NSDraggingInfo>)draggingInfo overElement:(NSDictionary *)element
+- (BOOL)webView:(WebView *)webView shouldProcessDragWithDraggingInfo:(id <NSDraggingInfo>)draggingInfo
 {
     return YES;
 }
diff --git a/WebKit/WebView.subproj/WebDocumentInternal.h b/WebKit/WebView.subproj/WebDocumentInternal.h
index 498f73d..14e8a5d 100644
--- a/WebKit/WebView.subproj/WebDocumentInternal.h
+++ b/WebKit/WebView.subproj/WebDocumentInternal.h
@@ -19,9 +19,8 @@
 @end
 
 @protocol WebDocumentDragging <NSObject>
-- (NSDragOperation)dragOperationForDraggingInfo:(id <NSDraggingInfo>)draggingInfo;
+- (NSDragOperation)draggingUpdatedWithDraggingInfo:(id <NSDraggingInfo>)draggingInfo;
 - (void)draggingCancelledWithDraggingInfo:(id <NSDraggingInfo>)draggingInfo;
-- (void)draggingUpdatedWithDraggingInfo:(id <NSDraggingInfo>)draggingInfo;
 - (BOOL)concludeDragForDraggingInfo:(id <NSDraggingInfo>)draggingInfo;
 @end
 
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index e39b295..d20f121 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -1704,12 +1704,15 @@ static WebHTMLView *lastHitView = nil;
     return NO;
 }
 
-- (NSDragOperation)dragOperationForDraggingInfo:(id <NSDraggingInfo>)draggingInfo
+- (NSDragOperation)draggingUpdatedWithDraggingInfo:(id <NSDraggingInfo>)draggingInfo
 {
     if ([self _canProcessDragWithDraggingInfo:draggingInfo]) {
+        [[self _bridge] moveDragCaretToPoint:[self convertPoint:[draggingInfo draggingLocation] fromView:nil]];
         return (_private->initiatedDrag && [[self _bridge] isSelectionEditable]) ? NSDragOperationMove : NSDragOperationCopy;
+    } else {
+        [[self _bridge] removeDragCaret];
+        return NSDragOperationNone;
     }
-    return NSDragOperationNone;
 }
 
 - (void)draggingCancelledWithDraggingInfo:(id <NSDraggingInfo>)draggingInfo
@@ -1717,15 +1720,6 @@ static WebHTMLView *lastHitView = nil;
     [[self _bridge] removeDragCaret];
 }
 
-- (void)draggingUpdatedWithDraggingInfo:(id <NSDraggingInfo>)draggingInfo
-{
-    if ([self _canProcessDragWithDraggingInfo:draggingInfo]) {
-        [[self _bridge] moveDragCaretToPoint:[self convertPoint:[draggingInfo draggingLocation] fromView:nil]];
-    } else {
-        [[self _bridge] removeDragCaret];
-    }
-}
-
 - (BOOL)concludeDragForDraggingInfo:(id <NSDraggingInfo>)draggingInfo
 {
     WebBridge *bridge = [self _bridge];
diff --git a/WebKit/WebView.subproj/WebUIDelegatePrivate.h b/WebKit/WebView.subproj/WebUIDelegatePrivate.h
index 2dc7b4d..78eca1a 100644
--- a/WebKit/WebView.subproj/WebUIDelegatePrivate.h
+++ b/WebKit/WebView.subproj/WebUIDelegatePrivate.h
@@ -14,4 +14,8 @@
 - (void)webView:(WebView *)sender drawHeaderInRect:(NSRect)rect;
 - (void)webView:(WebView *)sender drawFooterInRect:(NSRect)rect;
 
+- (BOOL)webView:(WebView *)webView shouldBeginDragForElement:(NSDictionary *)element pasteboard:(NSPasteboard *)pasteboard mouseDownEvent:(NSEvent *)mouseDownEvent mouseDraggedEvent:(NSEvent *)mouseDraggedEvent;
+- (BOOL)webView:(WebView *)webView shouldDetermineDragOperationForDraggingInfo:(id <NSDraggingInfo>)draggingInfo dragOperation:(NSDragOperation *)dragOperation;
+- (BOOL)webView:(WebView *)webView shouldProcessDragWithDraggingInfo:(id <NSDraggingInfo>)draggingInfo;
+
 @end
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index a09d296..3fe157d 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -1678,29 +1678,15 @@ NS_ENDHANDLER
     }
 }
 
+// New pending API:
+- (NSDictionary *)elementAtPoint:(NSPoint)point
+{
+    return [self _elementAtWindowPoint:[self convertPoint:point toView:nil]];
+}
+
+// FIXME: Remove this new API
 - (NSDragOperation)dragOperationForDraggingInfo:(id <NSDraggingInfo>)draggingInfo
 {    
-    // Allow the document view to handle the drag.
-    NSPoint windowPoint = [draggingInfo draggingLocation];
-    NSView <WebDocumentDragging> *draggingView = [self _draggingDocumentViewAtWindowPoint:windowPoint];
-    if (draggingView) {
-        NSDragOperation operation = [draggingView dragOperationForDraggingInfo:draggingInfo];
-        if (operation != NSDragOperationNone) {
-            return operation;
-        }
-    }
- 
-    // Don't accept the drag over a plug-in since plug-ins may want to handle it.
-    NSView *view = [self hitTest:[[self superview] convertPoint:windowPoint toView:nil]];
-    if ([view isKindOfClass:[WebBaseNetscapePluginView class]]) {
-        return NSDragOperationNone;
-    }
-    
-    // If not editing or dragging, use _web_dragOperationForDraggingInfo to find a URL to load on the pasteboard.
-    if (!_private->editable && !_private->initiatedDrag) {
-        return [self _web_dragOperationForDraggingInfo:draggingInfo];
-    }
-    
     return NSDragOperationNone;
 }
 
@@ -1721,14 +1707,25 @@ NS_ENDHANDLER
         [self _setDraggingDocumentView:newDraggingView];
     }
     
-    NSDragOperation operation = [[self _UIDelegateForwarder] webView:self 
-                                        dragOperationForDraggingInfo:draggingInfo 
-                                                         overElement:[self _elementAtWindowPoint:windowPoint]];
+    NSDragOperation operation = NSDragOperationNone;
+    if ([[self _UIDelegateForwarder] webView:self shouldDetermineDragOperationForDraggingInfo:draggingInfo dragOperation:&operation]) {
+        operation = [_private->draggingDocumentView draggingUpdatedWithDraggingInfo:draggingInfo];
+        if (operation == NSDragOperationNone) {
+            NSView *view = [self hitTest:[[self superview] convertPoint:windowPoint toView:nil]];
+            if ([view isKindOfClass:[WebBaseNetscapePluginView class]]) {
+                // Don't accept the drag over a plug-in since plug-ins may want to handle it.
+                operation = NSDragOperationNone;
+            } else if (!_private->editable && !_private->initiatedDrag) {
+                // If not editing or dragging, use _web_dragOperationForDraggingInfo to find a URL to load on the pasteboard.
+                operation = [self _web_dragOperationForDraggingInfo:draggingInfo];
+            }
+        }
+    }
+    
     if (operation == NSDragOperationNone) {
         [_private->draggingDocumentView draggingCancelledWithDraggingInfo:draggingInfo];
-    } else {
-        [_private->draggingDocumentView draggingUpdatedWithDraggingInfo:draggingInfo];
     }
+    
     return operation;
 }
 
@@ -1763,9 +1760,7 @@ NS_ENDHANDLER
     NSPoint windowPoint = [draggingInfo draggingLocation];
     ASSERT(_private->draggingDocumentView == [self _draggingDocumentViewAtWindowPoint:windowPoint]);
     
-    if (![[self _UIDelegateForwarder] webView:self 
-            shouldProcessDragWithDraggingInfo:draggingInfo 
-                                  overElement:[self _elementAtWindowPoint:windowPoint]]) {
+    if (![[self _UIDelegateForwarder] webView:self shouldProcessDragWithDraggingInfo:draggingInfo]) {
         [self _setDraggingDocumentView:nil];
         return;
     }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list