Bug 13652 - REGRESSION: WebCore::DragController crashes if WebDragSourceActionDHTML cleared
Summary: REGRESSION: WebCore::DragController crashes if WebDragSourceActionDHTML cleared
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P1 Normal
Assignee: Oliver Hunt
URL:
Keywords: InRadar, Regression
Depends on:
Blocks:
 
Reported: 2007-05-09 18:49 PDT by Justin Bur
Modified: 2007-07-13 23:10 PDT (History)
1 user (show)

See Also:


Attachments
Fix non-dhtml dragging (1.87 KB, patch)
2007-07-13 21:25 PDT, Oliver Hunt
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Bur 2007-05-09 18:49:34 PDT
If webView:dragSourceActionMaskForPoint: (WebUIDelegate protocol) is implemented and returns a mask in which the WebDragSourceActionDHTML bit is clear, dragging does not work when dragging ordinary text, links, etc. from that WebView.
- If another WebView in the same app (without this bit cleared) has already performed a successful drag, then the pasteboard will contain that previous drag's data.
- If no other WebView has already performed a successful drag operation, then DragController crashes, with a trashed stack.

To reproduce, simply implement the following in a WebUIDelegate:

- (unsigned)webView:(WebView *)sender dragSourceActionMaskForPoint:(NSPoint)point
{
	return (WebDragSourceActionAny & ~WebDragSourceActionDHTML);
}

Bug does not occur in WebKit released with OS X 10.4 Tiger. I don't know at what point it turned up in the nightlies. It is present in rev. 21322 of 2007-05-09.
Comment 1 Oliver Hunt 2007-07-13 21:00:51 PDT
<rdar://problem/5335265> 

Reproduced by bludgeoning WebDragClient
WebCore::DragSourceAction WebDragClient::dragSourceActionMaskForPoint(const IntPoint& windowPoint)
{
    return (DragSourceAction)(WebDragSourceActionAny & ~WebDragSourceActionDHTML);/*
    NSPoint viewPoint = [m_webView convertPoint:windowPoint fromView:nil];
    return (DragSourceAction)[[m_webView _UIDelegateForwarder] webView:m_webView dragSourceActionMaskForPoint:viewPoint];*/
}

We end up with a null clipboard, which is worrisome...
Comment 2 Oliver Hunt 2007-07-13 21:25:09 PDT
Created attachment 15510 [details]
Fix non-dhtml dragging

Righto, the problem was that we didn't preflight the clipboard unless we thought we might be performing a dhtml drag, which is an entirely unnecessary (and incorrect) requirement.
Comment 3 Oliver Hunt 2007-07-13 23:06:26 PDT
Landed in r24283