Changeset 19614 in webkit
- Timestamp:
- Feb 13, 2007, 2:57:31 PM (18 years ago)
- Location:
- trunk/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/ChangeLog
r19608 r19614 1 2007-02-13 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by John. 4 5 Modify entry point ASSERTs for dragging functions to allow for the case 6 where a load has occurred mid-drag. The load may detach the HTMLView 7 from the WebView so it is no longer possible to check _isTopHTMLView. 8 9 The assertion changes match that of revision 14897 which fixed the 10 more common case ([WebHTMLView draggedImage:endedAt:operation:]) 11 12 It's also necessary to check for a null Page now prior to accessing 13 the DragController, which is necessary in all of these methods. 14 15 See rdar://problem/4994870 16 17 * WebView/WebHTMLView.mm: 18 (-[WebHTMLView draggingSourceOperationMaskForLocal:]): 19 (-[WebHTMLView draggedImage:movedTo:]): 20 (-[WebHTMLView draggedImage:endedAt:operation:]): 21 (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): 22 1 23 2007-02-13 Alexey Proskuryakov <ap@webkit.org> 2 24 -
trunk/WebKit/WebView/WebHTMLView.mm
r19579 r19614 2926 2926 - (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal 2927 2927 { 2928 ASSERT( [self _isTopHTMLView]);2928 ASSERT(![self _webView] || [self _isTopHTMLView]); 2929 2929 2930 2930 Page *page = core([self _webView]); 2931 ASSERT(page); 2931 2932 if (!page) 2933 return NSDragOperationNone; 2934 2932 2935 if (page->dragController()->dragOperation() == DragOperationNone) 2933 2936 return NSDragOperationGeneric | NSDragOperationCopy; … … 2938 2941 - (void)draggedImage:(NSImage *)image movedTo:(NSPoint)screenLoc 2939 2942 { 2940 ASSERT([self _isTopHTMLView]); 2941 Page* page = core([self _webView]); 2942 ASSERT(page); 2943 DragController* dragController = page->dragController(); 2943 ASSERT(![self _webView] || [self _isTopHTMLView]); 2944 2944 2945 NSPoint windowImageLoc = [[self window] convertScreenToBase:screenLoc]; 2945 NSPoint windowMouseLoc = NSMakePoint(windowImageLoc.x + dragController->dragOffset().x(), windowImageLoc.y + dragController->dragOffset().y()); 2946 NSPoint windowMouseLoc = windowImageLoc; 2947 2948 if (Page* page = core([self _webView])) { 2949 DragController* dragController = page->dragController(); 2950 NSPoint windowMouseLoc = NSMakePoint(windowImageLoc.x + dragController->dragOffset().x(), windowImageLoc.y + dragController->dragOffset().y()); 2951 } 2952 2946 2953 [[self _bridge] dragSourceMovedTo:windowMouseLoc]; 2947 2954 } … … 2950 2957 { 2951 2958 ASSERT(![self _webView] || [self _isTopHTMLView]); 2952 Page* page = core([self _webView]); 2953 ASSERT(page); 2954 DragController* dragController = page->dragController(); 2955 2959 2956 2960 NSPoint windowImageLoc = [[self window] convertScreenToBase:aPoint]; 2957 NSPoint windowMouseLoc = NSMakePoint(windowImageLoc.x + dragController->dragOffset().x(), windowImageLoc.y + dragController->dragOffset().y()); 2961 NSPoint windowMouseLoc = windowImageLoc; 2962 2963 if (Page* page = core([self _webView])) { 2964 DragController* dragController = page->dragController(); 2965 windowMouseLoc = NSMakePoint(windowImageLoc.x + dragController->dragOffset().x(), windowImageLoc.y + dragController->dragOffset().y()); 2966 dragController->dragEnded(); 2967 } 2968 2958 2969 [[self _bridge] dragSourceEndedAt:windowMouseLoc operation:operation]; 2959 dragController->dragEnded();2960 2970 2961 2971 // Prevent queued mouseDragged events from coming after the drag and fake mouseUp event. … … 2979 2989 - (NSArray *)namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination 2980 2990 { 2981 ASSERT( [self _isTopHTMLView]);2991 ASSERT(![self _webView] || [self _isTopHTMLView]); 2982 2992 Page* page = core([self _webView]); 2993 2994 //If a load occurs midway through a drag, the view may be detached, which gives 2995 //us no ability to get to the original Page, so we cannot access any drag state 2996 //FIXME: is there a way to recover? 2997 if (!page) 2998 return nil; 2999 2983 3000 KURL imageURL = page->dragController()->draggingImageURL(); 2984 3001 ASSERT(!imageURL.isEmpty()); 2985 3002 2986 3003 NSFileWrapper *wrapper = [[self _dataSource] _fileWrapperForURL:imageURL.getNSURL()]; 2987 3004 if (wrapper == nil) {
Note:
See TracChangeset
for help on using the changeset viewer.