Bug 120538

Summary: [WK2][Mac] Drag and drop tests interfere with user's UI
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: Tools / TestsAssignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal CC: mitz, thorton
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 68552    
Attachments:
Description Flags
proposed fix mitz: review+, buildbot: commit-queue-

Description Alexey Proskuryakov 2013-08-30 10:35:03 PDT
Drag and drop happens on screen, taking away focus and sometimes even dropping text snippets into running applications. Crazy.
Comment 1 Alexey Proskuryakov 2013-08-30 11:00:15 PDT
Created attachment 210136 [details]
proposed fix
Comment 2 Build Bot 2013-08-30 17:47:08 PDT
Comment on attachment 210136 [details]
proposed fix

Attachment 210136 [details] did not pass win-ews (win):
Output: http://webkit-queues.appspot.com/results/1661151
Comment 3 mitz 2013-09-01 11:05:59 PDT
Comment on attachment 210136 [details]
proposed fix

View in context: https://bugs.webkit.org/attachment.cgi?id=210136&action=review

> Source/WebKit2/ChangeLog:8
> +        * UIProcess/API/mac/WKView.mm: (-[WKView _setDragImage:at:linkDrag:]): Make it possible

Missing newline after “mm:”.

> Source/WebKit2/UIProcess/API/mac/WKView.mm:2761
> +    [self dragImage:image
>                    at:clientPoint

Now the colons are not aligned!

> Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:438
>  				E1C642C417CBCD4C00D66A3C /* WebKitTestRunnerPasteboard.mm */,
> +				E132AA3817CD5F1000611DF0 /* WebKitTestRunnerDraggingInfo.mm */,
> +				E132AA3917CD5F1000611DF0 /* WebKitTestRunnerDraggingInfo.h */,
> +				E132AA3B17CE776F00611DF0 /* WebKitTestRunnerEvent.mm */,
> +				E132AA3C17CE776F00611DF0 /* WebKitTestRunnerEvent.h */,

Not in alphabetical order.

> Tools/WebKitTestRunner/mac/WebKitTestRunnerDraggingInfo.h:27
> +#ifndef WebKitTestRunnerDraggingInfo_h
> +#define WebKitTestRunnerDraggingInfo_h

Such guards aren’t needed in Objective-C headers, because implementation files should #import them.

> Tools/WebKitTestRunner/mac/WebKitTestRunnerDraggingInfo.h:29
> +#import <Cocoa/Cocoa.h>

Is this needed?

> Tools/WebKitTestRunner/mac/WebKitTestRunnerDraggingInfo.h:36
> +    NSSize offset;
> +    NSImage *draggedImage;
> +    NSPasteboard *draggingPasteboard;
> +    id draggingSource;

Normally ivar names have a _ prefix.

> Tools/WebKitTestRunner/mac/WebKitTestRunnerDraggingInfo.mm:37
> +- (id)initWithImage:(NSImage *)anImage offset:(NSSize)o pasteboard:(NSPasteboard *)pboard source:(id)source

If you rename the ivars to start with an underscore, you could use “image”, “offset”, and “pasteboard” as the parameter names.

> Tools/WebKitTestRunner/mac/WebKitTestRunnerEvent.h:27
> +#ifndef WebKitTestRunnerEvent_h
> +#define WebKitTestRunnerEvent_h

No need for this.
Comment 4 Alexey Proskuryakov 2013-09-01 23:36:01 PDT
Committed <http://trac.webkit.org/r154949>.