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

Issue 650724 link

Starred by 1 user

Issue metadata

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



Sign in to add a comment

Copy Image Does Not Copy Image Into Keynote

Reported by rapon...@gmail.com, Sep 27 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36

Example URL:

Steps to reproduce the problem:
1. In Chrome, perform an image search for any image.
2. Select an image. 
3. Right click the image and select Copy Image.
4. Open Keynote (Updated version 6.6.2 (2571).
5. Right click on the slide and select Paste.
6. Note that the url of the image - not the image - is pasted.

What is the expected behavior?
The image should be pasted.

What went wrong?
Users are unable to use the Copy Image function in Chrome and paste the image into Keynote. This feature works in Safari.

Does it occur on multiple sites: Yes

Is it a problem with a plugin? N/A 

Did this work before? Yes Approximately 3 months ago.

Does this work in other browsers? Yes 

Chrome version: 53.0.2785.116  Channel: stable
OS Version: OS X 10.11.6
Flash Version: Shockwave Flash 23.0 r0
 
Components: -Blink Blink>DataTransfer
Owner: pwnall@chromium.org
Status: Assigned (was: Unconfirmed)
Thank you very much for your bug report!

Reproduced on OS X 10.11.6 with Keynote 6.6.2 and Chrome 53.0.2785.116. Also reproduces on a Chromium build off of master (55.0.2881.0).

Tightened reproduction steps:
1. In Chrome, open https://www.google.com/search?tbm=isch&q=chrome
2. Right-click on the first image result (should be a Chrome logo, doesn't matter too much)
3. Open Keynote
4. Press Apple+V to trigger a Paste action (right-clicking and selecting Paste from the dropdown works as well)

Expected: The Chrome logo should show up on the slide.

Actual: An URL shows up on the slide.

Extra information:

TextEdit pastes the image correctly.
Safari 10.0 (11602.1.50.0.10) copies an image that is pasted correctly in both TextEdit and Keynote.
Cc: erikc...@chromium.org
I used Apple's Clipboard Viewer [1] to inspect the clipboard contents. It seems like Safari (correctly) places the image data before the URL, and we place the URL before the image. Screenshots of the two lists attached.

[1] https://developer.apple.com/library/content/samplecode/ClipboardViewer/Introduction/Intro.html
safari-clipboard-types.png
108 KB View Download
chrome-clipboard-types.png
95.5 KB View Download
Code trace:

(browser) RenderFrameHostImpl::CopyImageAt -> (renderer) WebLocalFrameImpl::copyImageAt -> (blink) Editor::copyImage -> (blink) Pasteboard::writeImage -> (renderer) WebClipboardImpl::writeImage -> 3 calls

1) (renderer) RendererClipboardDelegate::WriteImage -> (browser) ClipboardMessageFilter::OnWriteImage -> ScopedClipboardWriter::WriteImage
2) (renderer) RendererClipboardDelegate::WriteBookmark -> (browser) ClipboardMessageFilter::OnWriteBookmark -> ScopedClipboardWriter::WriteBookmark
3) (renderer) RendererClipboardDelegate::CommitWrite -> (browser) ClipboardMessageFilter::OnCommitWrite -> ScopedClipboardWriter::~ScopedClipboardWriter (via unique_ptr::reset) -> Clipboard::WriteObjects ~= ClipboardMac::WriteObjects

The issue is that ClipboardMac::WriteObject iterates over the vector of data to write in the order indicated by the format. Reordering the formats fixes the issue, as shown in CL https://codereview.chromium.org/2394773003

Now I'll see if this change breaks other OSes.
Project Member

Comment 6 by bugdroid1@chromium.org, Oct 6 2016

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

commit 736fcf0e7bef083610434b607e855df13cdccc79
Author: pwnall <pwnall@chromium.org>
Date: Thu Oct 06 00:10:38 2016

Reorder clipboard data types in ui/base/clipboard/clipboard.h

The order in which the data types (formats) are listed in that file is
used when transferring Chrome's clipboard contents to the OS clipboard.
In some OSes, the order in which the data types are written to the
clipboard matters -- an earlier type may represent the data with more
accuracy than a later type.

This CL sets up a reasonable order, and fixes an image copying bug.

BUG= 650724 
TEST=manual, using the repro steps in the bug

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

[modify] https://crrev.com/736fcf0e7bef083610434b607e855df13cdccc79/ui/base/clipboard/clipboard.h

Cc: kavvaru@chromium.org
Labels: Needs-Feedback
Tested the issue on Mac 10.11.6 using chrome version 55.0.2882.0 with the steps below

1. Go to URL  https://www.google.com/search?tbm=isch&q=chrome
2. Right-click and select copy image on the first image 
3. Open Keynote
4. right-click and selected Paste option
5. Observed that URL pastes instead of image

pwnall@ Could you please check the attached screen cast and confirm on the fix.please let me know if any steps missed here.

Thanks,
650724.mp4
4.7 MB View Download
Labels: -Needs-Feedback
Status: Fixed (was: Assigned)
Summary: Copy Image Does Not Copy Image Into Keynote (was: Copy Image Does Not Copy Image Into KeyNote)
kavvaru@ Thank you for the verification attempt!

I'm fairly sure that the bug refers to Apple's Keynote app [1]. The capitalization was incorrect in the bug title (I just fixed it), but the version number in step 4 of the bug description -- 6.6.2 (2571) -- matches the last Keynote version available for OS X 10.11.

Everything else is correct -- Chrome 55.0.2882.0 includes the CL for this bug. I just ran the steps myself, so I marked the bug as fixed. You're welcome to verify it, if you have time.

[1] http://www.apple.com/keynote/
Project Member

Comment 9 by bugdroid1@chromium.org, Oct 27 2016

Labels: merge-merged-2840
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/736fcf0e7bef083610434b607e855df13cdccc79

commit 736fcf0e7bef083610434b607e855df13cdccc79
Author: pwnall <pwnall@chromium.org>
Date: Thu Oct 06 00:10:38 2016

Reorder clipboard data types in ui/base/clipboard/clipboard.h

The order in which the data types (formats) are listed in that file is
used when transferring Chrome's clipboard contents to the OS clipboard.
In some OSes, the order in which the data types are written to the
clipboard matters -- an earlier type may represent the data with more
accuracy than a later type.

This CL sets up a reasonable order, and fixes an image copying bug.

BUG= 650724 
TEST=manual, using the repro steps in the bug

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

[modify] https://crrev.com/736fcf0e7bef083610434b607e855df13cdccc79/ui/base/clipboard/clipboard.h

Comment 10 by dimu@google.com, Nov 4 2016

Labels: -merge-merged-2840
[Automated comment] removing mislabelled merge-merged-2840

Sign in to add a comment