New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 610085 link

Starred by 23 users

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Can't drag image to Google Image Search from title bar proxy icon

Project Member Reported by a...@chromium.org, May 7 2016

Issue description

Chrome Version       : 52.0.2716.0
OS Version: OS X 10.11.4
URLs (if applicable) :

What steps will reproduce the problem?
1. Have a jpg file.
2. From the Finder, drag it into a Google Image Search window.

> GIS properly accepts the drag and processes it. :)

3. Open the jpg file in Preview.
4. From Preview, drag the title bar proxy icon into a Google Image Search window.

> GIS doesn't accept the drag.

The drags are different.

From the Finder we get flavors:

PasteboardRef: 1349872  ItemCount: 1
   Index: 1  item ID: 789514
      "public.file-url"
      'furl' ______ 32  file:///private/tmp/Untitled.png
--

      "com.apple.finder.node"
      '' ______ 33  file:///.file/id=6571367.12011757
--

      "dyn.ah62d4rv4gk80u3xxea"
      'hfs ' PT____ 80  fGNP????    @,   Untitled.png

From Preview we get flavors:

PasteboardRef: 4295504  ItemCount: 1
   Index: 1  item ID: 789514
      "dyn.ah62d4rv4gu8y6y4grf0gn5xbrzw1gydcr7u1e3cytf2gn"
      "NSFilenamesPboardType"
      '' ______ 236  <?xml version="1.0" ...
--

      "public.file-url"
      ""
      'furl' ______ 36  file:///private/tmp/Untitled%202.png
--

      "dyn.ah62d4rv4gk80u3xxea"
      ""
      'hfs ' PT____ 80  fGNP...


Is the NSFilenamesPboardType blocking our ability to see "public.file-url"?

 

Comment 1 by a...@chromium.org, May 7 2016

Labels: -Pri-3 Pri-2

Comment 2 by a...@chromium.org, May 25 2016

-performDragOperation:view: is not getting called for the drop.
That generally happens because the receiving view isn't set up correctly to retrieve the drop. registerForDraggedTypes: is finicky, especially with regards to old-style pboard names, and new-style URIs.

Comment 4 by a...@chromium.org, May 25 2016

No... RenderViewImpl::OnDragTargetDragOver is returning 0 rather than 1. Therefore, -draggingUpdated: returns 0 (NSDragOperationNone) and AppKit never bothers to do the drop.

What's weird is that -[WebDragDestMac populateDropData:fromPasteboard:] fills in the DropData identically. I have no idea why Blink is unhappy here.

Comment 5 by a...@chromium.org, May 25 2016

For the titlebar case, in WebViewImpl::dragTargetDragEnterOrOver the lines:

    if (!(dropEffect & dragData.draggingSourceOperationMask()))
        dropEffect = DragOperationNone;

are what clears out the drag. Searching for why the mask differs here.

Comment 6 by a...@chromium.org, May 25 2016

Here are the two situations:

Dragging a file, the -[NSDraggingInfo draggingSourceOperationMask] is NSDragOperationEvery. For some reason, dragging a file into Chromium is NSDragOperationMove, so that's allowed.

For dragging a window proxy, the -[NSDraggingInfo draggingSourceOperationMask] is NSDragOperationCopy | NSDragOperationLink | NSDragOperationGeneric. Thus NSDragOperationMove isn't allowed and it fails.

So this is Chromium's problem. Why is NSDragOperationMove used? When you drag a file into Chromium, it is a copy, not a move.

Comment 7 by a...@chromium.org, May 25 2016

DragController::dragEnteredOrUpdated calls
DragController::tryDocumentDrag calls
DragController::tryDHTMLDrag which has:

    if (dataTransfer->dropEffectIsUninitialized()) {
        operation = defaultOperationForDrag(srcOpMask);
    }

Since the drop effect is uninitialized (it's external) we fall to defaultOperationForDrag, which turns DragOperationGeneric into DragOperationMove.

Can we initialize external file drags to be copy?

Comment 8 by a...@chromium.org, May 25 2016

I'm not sure. It doesn't seem possible to set the destination operation from the Chromium side. Should we bandaid from the Chromium side to say that if Blink says this is a move, then lie to AppKit and say it's a copy?
Cc: -a...@chromium.org erikc...@chromium.org
Owner: a...@chromium.org
Reassigning to avi@ because he's actually be looking into this.
Components: Blink>DataTransfer
Project Member

Comment 11 by bugdroid1@chromium.org, Jul 13 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/57b70dae30c2bc7d60e70efd8ebae83e01fe9119

commit 57b70dae30c2bc7d60e70efd8ebae83e01fe9119
Author: avi <avi@chromium.org>
Date: Wed Jul 13 01:45:34 2016

Don't pick a drop operation that the source doesn't support.

If a page doesn't specify a drop operation, DragController's defaultOperationForDrag() makes an attempt to choose a reasonable operation based on what the source supports.

Unfortunately, if the source supports "generic" but not move, defaultOperationForDrag() chooses an operation that the source doesn't support, and the drop fails.

Fix it by not returning "move" if it is not supported.

BUG= 610085 
TEST=none
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel,mac_blink_rel,win_blink_rel

Review-Url: https://codereview.chromium.org/2030683003
Cr-Commit-Position: refs/heads/master@{#404885}

[modify] https://crrev.com/57b70dae30c2bc7d60e70efd8ebae83e01fe9119/third_party/WebKit/Source/core/page/DragController.cpp

Comment 12 by a...@chromium.org, Jul 13 2016

Status: Fixed (was: Assigned)

Comment 13 by a...@chromium.org, Jul 19 2016

Cc: a...@chromium.org tkonch...@chromium.org manoranj...@chromium.org
 Issue 234931  has been merged into this issue.

Sign in to add a comment