[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:45:29 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 52c952d05e61978c752182f527cbb62d04f49c09
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Jun 14 18:50:39 2004 +0000
Fixed: <rdar://problem/3674456> make new drag & drop API compatible with DHTML dragging
Reviewed by trey.
* WebView.subproj/WebHTMLView.m:
(-[WebHTMLView concludeDragForDraggingInfo:actionMask:]): tweak
* WebView.subproj/WebUIDelegate.h: removed old, added new methods
* WebView.subproj/WebUIDelegatePrivate.h: moved new methods to public header
* WebView.subproj/WebView.h: removed old, added new methods
* WebView.subproj/WebView.m: moved methods around
(-[WebView moveDragCaretToPoint:]): moved
(-[WebView removeDragCaret]): moved
(-[WebView _bridgeAtPoint:]): moved
(-[WebView editableDOMRangeForPoint:]): moved
* WebView.subproj/WebViewInternal.h: add new internal method
* WebView.subproj/WebViewPrivate.h: moved new methods to public header
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6829 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 4ced167..536fc94 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,22 @@
+2004-06-14 Chris Blumenberg <cblu at apple.com>
+
+ Fixed: <rdar://problem/3674456> make new drag & drop API compatible with DHTML dragging
+
+ Reviewed by trey.
+
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView concludeDragForDraggingInfo:actionMask:]): tweak
+ * WebView.subproj/WebUIDelegate.h: removed old, added new methods
+ * WebView.subproj/WebUIDelegatePrivate.h: moved new methods to public header
+ * WebView.subproj/WebView.h: removed old, added new methods
+ * WebView.subproj/WebView.m: moved methods around
+ (-[WebView moveDragCaretToPoint:]): moved
+ (-[WebView removeDragCaret]): moved
+ (-[WebView _bridgeAtPoint:]): moved
+ (-[WebView editableDOMRangeForPoint:]): moved
+ * WebView.subproj/WebViewInternal.h: add new internal method
+ * WebView.subproj/WebViewPrivate.h: moved new methods to public header
+
2004-06-14 Trey Matteson <trey at apple.com>
Use a different hack, as recommended by Kristin, to force the drag
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index 03e89bd..9a1ba81 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -1906,7 +1906,7 @@ static WebHTMLView *lastHitView = nil;
if (_private->webCoreHandlingDrag) {
ASSERT(actionMask & WebDragDestinationActionDHTML);
[[webView _UIDelegateForwarder] webView:webView willPerformDragDestinationAction:WebDragDestinationActionDHTML forDraggingInfo:draggingInfo];
- [[self _bridge] concludeDragForDraggingInfo:draggingInfo];
+ [bridge concludeDragForDraggingInfo:draggingInfo];
return YES;
} else if (actionMask & WebDragDestinationActionEdit) {
BOOL didInsert = NO;
diff --git a/WebKit/WebView.subproj/WebUIDelegate.h b/WebKit/WebView.subproj/WebUIDelegate.h
index 2c7ac2b..6116c30 100644
--- a/WebKit/WebView.subproj/WebUIDelegate.h
+++ b/WebKit/WebView.subproj/WebUIDelegate.h
@@ -31,6 +31,42 @@ enum {
};
/*!
+ @enum WebDragDestinationAction
+ @abstract Actions that the destination of a drag can perform.
+ @constant WebDragDestinationActionNone No action
+ @constant WebDragDestinationActionDHTML Allows DHTML (such as JavaScript) to handle the drag
+ @constant WebDragDestinationActionEdit Allows editable documents to be edited from the drag
+ @constant WebDragDestinationActionLoad Allows a location change from the drag
+ @constant WebDragDestinationActionAny Allows any of the above to occur
+*/
+typedef enum {
+ WebDragDestinationActionNone = 0,
+ WebDragDestinationActionDHTML = 1,
+ WebDragDestinationActionEdit = 2,
+ WebDragDestinationActionLoad = 4,
+ WebDragDestinationActionAny = UINT_MAX
+} WebDragDestinationAction;
+
+/*!
+ @enum WebDragSourceAction
+ @abstract Actions that the source of a drag can perform.
+ @constant WebDragSourceActionNone No action
+ @constant WebDragSourceActionDHTML Allows DHTML (such as JavaScript) to start a drag
+ @constant WebDragSourceActionImage Allows an image drag to occur
+ @constant WebDragSourceActionLink Allows a link drag to occur
+ @constant WebDragSourceActionSelection Allows a selection drag to occur
+ @constant WebDragSourceActionAny Allows any of the above to occur
+*/
+typedef enum {
+ WebDragSourceActionNone = 0,
+ WebDragSourceActionDHTML = 1,
+ WebDragSourceActionImage = 2,
+ WebDragSourceActionLink = 4,
+ WebDragSourceActionSelection = 8,
+ WebDragSourceActionAny = UINT_MAX
+} WebDragSourceAction;
+
+/*!
@protocol WebOpenPanelResultListener
@discussion This protocol is used to call back with the results of
the file open panel requested by runOpenPanelForFileButtonWithResultListener:
@@ -346,40 +382,48 @@ enum {
- (BOOL)webView:(WebView *)webView shouldPerformAction:(SEL)action fromSender:(id)sender;
/*!
- @method webView:shouldBeginDragForElement:dragImage:mouseDownEvent:mouseDraggedEvent:
- @abstract Controls behavior when dragging from a WebView
+ @method webView:dragDestinationActionMaskForDraggingInfo:
+ @abstract Controls behavior when dragging to a WebView
@param webView The WebView sending the delegate method
- @param element The element being dragged
- @param dragImage The drag image representing the element being dragged
- @param mouseDownEvent The mouse down event that started the drag
- @param mouseDraggedEvent The mouse dragged event that started the drag
- @discussion This method allows the UI delegate to control WebView's behavior when a drag has begun. The delegate
- can return YES to allow WebView to start the drag or return NO to disallow the drag or customize the drag in some
- other way.
+ @param draggingInfo The dragging info of the drag
+ @discussion This method is called periodically as something is dragged over a WebView. The UI delegate can return a mask
+ indicating which drag destination actions can occur, WebDragDestinationActionAny to allow any kind of action or
+ WebDragDestinationActionNone to not accept the drag.
*/
-- (BOOL)webView:(WebView *)webView shouldBeginDragForElement:(NSDictionary *)element dragImage:(NSImage *)dragImage mouseDownEvent:(NSEvent *)mouseDownEvent mouseDraggedEvent:(NSEvent *)mouseDraggedEvent;
+- (unsigned)webView:(WebView *)webView dragDestinationActionMaskForDraggingInfo:(id <NSDraggingInfo>)draggingInfo;
/*!
- @method webView:dragOperationForDraggingInfo:overElement:
- @abstract Controls behavior when dragging to a WebView
+ @method webView:willPerformDragDestinationAction:forDraggingInfo:
+ @abstract Informs that WebView will perform a drag destination action
@param webView The WebView sending the delegate method
+ @param action The drag destination action
@param draggingInfo The dragging info of the drag
- @param element The element that is under the drag
- @discussion This method allows the UI delegate to control WebView's behavior when something is being dragged to
- the WebView. The delegate can return the value returned by WebView's dragOperationForDraggingInfo: method,
- NSDragOperationNone to invalidate the drag or another drag operation.
+ @discussion This method is called after the last call to webView:dragDestinationActionMaskForDraggingInfo: after something is dropped on a WebView.
+ This method informs the UI delegate of the drag destination action that WebView will perform.
*/
-- (NSDragOperation)webView:(WebView *)webView dragOperationForDraggingInfo:(id <NSDraggingInfo>)draggingInfo overElement:(NSDictionary *)element;
+- (void)webView:(WebView *)webView willPerformDragDestinationAction:(WebDragDestinationAction)action forDraggingInfo:(id <NSDraggingInfo>)draggingInfo;
/*!
- @method webView:shouldProcessDragWithDraggingInfo:overElement:
- @abstract Controls behavior when something is dropped on a WebView
+ @method webView:dragSourceActionMaskForPoint:
+ @abstract Controls behavior when dragging from a WebView
@param webView The WebView sending the delegate method
- @param draggingInfo The dragging info of the drag
- @param element The element that is under the drag
- @discussion This method allows the UI delegate to control WebView's behavior when something is dropped on a WebView.
- The delegate can return YES to allow WebView to process the drag or return NO and process the drag in some other way.
+ @param point The point where the drag started in the coordinates of the WebView
+ @discussion This method is called after the user has begun a drag from a WebView. The UI delegate can return a mask indicating
+ which drag source actions can occur, WebDragSourceActionAny to allow any kind of action or WebDragSourceActionNone to not begin a drag.
*/
-- (BOOL)webView:(WebView *)webView shouldProcessDragWithDraggingInfo:(id <NSDraggingInfo>)draggingInfo overElement:(NSDictionary *)element;
+- (unsigned)webView:(WebView *)webView dragSourceActionMaskForPoint:(NSPoint)point;
+
+/*!
+ @method webView:willPerformDragSourceAction:fromPoint:withPasteboard:
+ @abstract Informs that a drag a has begun from a WebView
+ @param webView The WebView sending the delegate method
+ @param action The drag source action
+ @param point The point where the drag started in the coordinates of the WebView
+ @param pasteboard The drag pasteboard
+ @discussion This method is called after webView:dragSourceActionMaskForPoint: is called after the user has begun a drag from a WebView.
+ This method informs the UI delegate of the drag source action that will be performed and gives the delegate an opportunity to modify
+ the contents of the dragging pasteboard.
+*/
+- (void)webView:(WebView *)webView willPerformDragSourceAction:(WebDragSourceAction)action fromPoint:(NSPoint)point withPasteboard:(NSPasteboard *)pasteboard;
@end
diff --git a/WebKit/WebView.subproj/WebUIDelegatePrivate.h b/WebKit/WebView.subproj/WebUIDelegatePrivate.h
index bd24b94..1fc27b5 100644
--- a/WebKit/WebView.subproj/WebUIDelegatePrivate.h
+++ b/WebKit/WebView.subproj/WebUIDelegatePrivate.h
@@ -5,42 +5,6 @@
#import <WebKit/WebUIDelegate.h>
-/*!
- @enum WebDragDestinationAction
- @abstract Actions that the destination of a drag can perform.
- @constant WebDragDestinationActionNone No action
- @constant WebDragDestinationActionDHTML Allows DHTML (such as JavaScript) to handle the drag
- @constant WebDragDestinationActionEdit Allows editable documents to be edited from the drag
- @constant WebDragDestinationActionLoad Allows a location change from the drag
- @constant WebDragDestinationActionAny Allows any of the above to occur
-*/
-typedef enum {
- WebDragDestinationActionNone = 0,
- WebDragDestinationActionDHTML = 1,
- WebDragDestinationActionEdit = 2,
- WebDragDestinationActionLoad = 4,
- WebDragDestinationActionAny = UINT_MAX
-} WebDragDestinationAction;
-
-/*!
- @enum WebDragSourceAction
- @abstract Actions that the source of a drag can perform.
- @constant WebDragSourceActionNone No action
- @constant WebDragSourceActionDHTML Allows DHTML (such as JavaScript) to start a drag
- @constant WebDragSourceActionImage Allows an image drag to occur
- @constant WebDragSourceActionLink Allows a link drag to occur
- @constant WebDragSourceActionSelection Allows a selection drag to occur
- @constant WebDragSourceActionAny Allows any of the above to occur
-*/
-typedef enum {
- WebDragSourceActionNone = 0,
- WebDragSourceActionDHTML = 1,
- WebDragSourceActionImage = 2,
- WebDragSourceActionLink = 4,
- WebDragSourceActionSelection = 8,
- WebDragSourceActionAny = UINT_MAX
-} WebDragSourceAction;
-
@interface NSObject (WebUIDelegatePrivate)
- (void)webViewPrint:(WebView *)sender;
@@ -51,49 +15,4 @@ typedef enum {
- (void)webView:(WebView *)sender drawFooterInRect:(NSRect)rect;
- (void)webView:(WebView *)webView addMessageToConsole:(NSDictionary *)message;
-/*!
- @method webView:dragDestinationActionMaskForDraggingInfo:
- @abstract Controls behavior when dragging to a WebView
- @param webView The WebView sending the delegate method
- @param draggingInfo The dragging info of the drag
- @discussion This method is called periodically as something is dragged over a WebView. The UI delegate can return a mask
- indicating which drag destination actions can occur, WebDragDestinationActionAny to allow any kind of action or
- WebDragDestinationActionNone to not accept the drag.
-*/
-- (unsigned)webView:(WebView *)webView dragDestinationActionMaskForDraggingInfo:(id <NSDraggingInfo>)draggingInfo;
-
-/*!
- @method webView:willPerformDragDestinationAction:forDraggingInfo:
- @abstract Informs that WebView will perform a drag destination action
- @param webView The WebView sending the delegate method
- @param action The drag destination action
- @param draggingInfo The dragging info of the drag
- @discussion This method is called after the last call to webView:dragDestinationActionMaskForDraggingInfo: after something is dropped on a WebView.
- This method informs the UI delegate of the drag destination that WebView will perform.
-*/
-- (void)webView:(WebView *)webView willPerformDragDestinationAction:(WebDragDestinationAction)action forDraggingInfo:(id <NSDraggingInfo>)draggingInfo;
-
-/*!
- @method webView:dragSourceActionMaskForPoint:
- @abstract Controls behavior when dragging from a WebView
- @param webView The WebView sending the delegate method
- @param point The point where the drag started in the coordinates of the WebView
- @discussion This method is called after the user has begun a drag from a WebView. The UI delegate can return a mask indicating
- which drag source actions can occur, WebDragSourceActionAny to allow any kind of action or WebDragSourceActionNone to not begin a drag.
-*/
-- (unsigned)webView:(WebView *)webView dragSourceActionMaskForPoint:(NSPoint)point;
-
-/*!
- @method webView:willPerformDragSourceAction:fromPoint:withPasteboard:
- @abstract Informs that a drag a has begun from a WebView
- @param webView The WebView sending the delegate method
- @param action The drag source action
- @param point The point where the drag started in the coordinates of the WebView
- @param pasteboard The drag pasteboard
- @discussion This method is called after webView:dragSourceActionMaskForPoint: is called after the user has begun a drag from a WebView.
- This method informs the UI delegate of the drag source action that will be performed and gives the delegate an opportunity to modify
- the contents of the dragging pasteboard.
-*/
-- (void)webView:(WebView *)webView willPerformDragSourceAction:(WebDragSourceAction)action fromPoint:(NSPoint)point withPasteboard:(NSPasteboard *)pasteboard;
-
@end
diff --git a/WebKit/WebView.subproj/WebView.h b/WebKit/WebView.subproj/WebView.h
index 3682550..4732d2f 100644
--- a/WebKit/WebView.subproj/WebView.h
+++ b/WebKit/WebView.subproj/WebView.h
@@ -478,12 +478,11 @@ extern NSString *WebViewProgressFinishedNotification;
- (double)estimatedProgress;
/*!
- @method dragOperationForDraggingInfo:
- @abstract Returns a drag operation for a dragging info
- @param draggingInfo The dragging info
- @result The drag operation
+ @method elementAtPoint:
+ @param point A point in the coordinates of the WebView
+ @result An element dictionary describing the point
*/
-- (NSDragOperation)dragOperationForDraggingInfo:(id <NSDraggingInfo>)draggingInfo;
+- (NSDictionary *)elementAtPoint:(NSPoint)point;
/*!
@method pasteboardTypesForSelection
@@ -515,6 +514,20 @@ extern NSString *WebViewProgressFinishedNotification;
*/
- (void)writeElement:(NSDictionary *)element withPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard;
+/*!
+ @method moveDragCaretToPoint:
+ @param point A point in the coordinates of the WebView
+ @discussion This method moves the caret that shows where something being dragged will be dropped. It may cause the WebView to scroll
+ to make the new position of the drag caret visible.
+*/
+- (void)moveDragCaretToPoint:(NSPoint)point;
+
+/*!
+ @method removeDragCaret
+ @abstract Removes the drag caret from the WebView
+*/
+- (void)removeDragCaret;
+
@end
@@ -546,6 +559,7 @@ extern NSString * const WebViewDidChangeSelectionNotification;
@end
@interface WebView (WebViewEditing)
+- (DOMRange *)editableDOMRangeForPoint:(NSPoint)point;
- (void)setSelectedDOMRange:(DOMRange *)range affinity:(NSSelectionAffinity)selectionAffinity;
- (DOMRange *)selectedDOMRange;
- (NSSelectionAffinity)selectionAffinity;
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index 4fb3527..fdfdc7d 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -1689,18 +1689,11 @@ 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
-{
- return NSDragOperationNone;
-}
-
- (void)_setDraggingDocumentView:(NSView <WebDocumentDragging> *)newDraggingView
{
if (_private->draggingDocumentView != newDraggingView) {
@@ -1972,6 +1965,23 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
}
}
+- (void)moveDragCaretToPoint:(NSPoint)point
+{
+ WebBridge *bridge = [self _bridgeAtPoint:point];
+ if (bridge != _private->dragCaretBridge) {
+ [_private->dragCaretBridge removeDragCaret];
+ _private->dragCaretBridge = [bridge retain];
+ }
+ [_private->dragCaretBridge moveDragCaretToPoint:[self convertPoint:point toView:[[[_private->dragCaretBridge webFrame] frameView] documentView]]];
+}
+
+- (void)removeDragCaret
+{
+ [_private->dragCaretBridge removeDragCaret];
+ [_private->dragCaretBridge release];
+ _private->dragCaretBridge = nil;
+}
+
@end
@implementation WebView (WebIBActions)
@@ -2170,33 +2180,6 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
}
}
-- (WebBridge *)_bridgeAtPoint:(NSPoint)point
-{
- return [[[self _frameViewAtWindowPoint:[self convertPoint:point toView:nil]] webFrame] _bridge];
-}
-
-- (DOMRange *)editableDOMRangeForPoint:(NSPoint)point
-{
- return [[self _bridgeAtPoint:point] editableDOMRangeForPoint:point];
-}
-
-- (void)moveDragCaretToPoint:(NSPoint)point
-{
- WebBridge *bridge = [self _bridgeAtPoint:point];
- if (bridge != _private->dragCaretBridge) {
- [_private->dragCaretBridge removeDragCaret];
- _private->dragCaretBridge = [bridge retain];
- }
- [_private->dragCaretBridge moveDragCaretToPoint:[self convertPoint:point toView:[[[_private->dragCaretBridge webFrame] frameView] documentView]]];
-}
-
-- (void)removeDragCaret
-{
- [_private->dragCaretBridge removeDragCaret];
- [_private->dragCaretBridge release];
- _private->dragCaretBridge = nil;
-}
-
@end
@implementation WebView (WebViewPrintingPrivate)
@@ -2359,10 +2342,20 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
return (WebFrameView *)[view _web_superviewOfClass:[WebFrameView class] stoppingAtClass:[self class]];
}
+- (WebBridge *)_bridgeAtPoint:(NSPoint)point
+{
+ return [[[self _frameViewAtWindowPoint:[self convertPoint:point toView:nil]] webFrame] _bridge];
+}
+
@end
@implementation WebView (WebViewEditing)
+- (DOMRange *)editableDOMRangeForPoint:(NSPoint)point
+{
+ return [[self _bridgeAtPoint:point] editableDOMRangeForPoint:point];
+}
+
- (BOOL)_interceptEditingKeyEvent:(NSEvent *)event
{
// Work around this bug:
diff --git a/WebKit/WebView.subproj/WebViewInternal.h b/WebKit/WebView.subproj/WebViewInternal.h
index b70ec99..e6fe3a5 100644
--- a/WebKit/WebView.subproj/WebViewInternal.h
+++ b/WebKit/WebView.subproj/WebViewInternal.h
@@ -91,6 +91,7 @@
- (BOOL)_isLoading;
- (WebFrameView *)_frameViewAtWindowPoint:(NSPoint)point;
+- (WebBridge *)_bridgeAtPoint:(NSPoint)point;
@end;
@interface WebView (WebViewEditingExtras)
diff --git a/WebKit/WebView.subproj/WebViewPrivate.h b/WebKit/WebView.subproj/WebViewPrivate.h
index 37081fc..4f86d4c 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.h
+++ b/WebKit/WebView.subproj/WebViewPrivate.h
@@ -50,27 +50,6 @@ extern NSString *_WebMainFrameURLKey;
- (void)toggleSmartInsertDelete:(id)sender;
-/*!
- @method editableDOMRangeForPoint:
- @param point A point in the coordinates of the WebView
- @result A range expressing an editable position. Nil is returned if an editable position can't be found.
-*/
-- (DOMRange *)editableDOMRangeForPoint:(NSPoint)point;
-
-/*!
- @method moveDragCaretToPoint:
- @param point A point in the coordinates of the WebView
- @discussion This method moves the caret that shows where something being dragged will be dropped. It may cause the WebView to scroll
- to make the new position of the drag caret visible.
-*/
-- (void)moveDragCaretToPoint:(NSPoint)point;
-
-/*!
- @method removeDragCaret
- @abstract Removes the drag caret from the WebView
-*/
-- (void)removeDragCaret;
-
@end
@interface WebView (WebPrivate)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list