New issue
Advanced search Search tips

Issue 753612 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Can't trigger copy event on cmd+c

Reported by is...@superhuman.com, Aug 9 2017

Issue description

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

Steps to reproduce the problem:
1. Open this jsfiddle: https://jsfiddle.net/a469yLz5/
2. Open dev tools console
3. Click in the frame on the lower right
4. Press "cmd+c"

If you change the check of "cmd+c" to any other keypress (e.g. "cmd+j") then copy works

What is the expected behavior?
`document.execCommand('copy')` calls the copy event listener and `onCopy` adds data to the clipboard.

What went wrong?
The copy event listener is never called and no data is added to the clipboard.

Did this work before? Yes 60

Does this work in other browsers? N/A

Chrome version: 61.0.3163.31  Channel: beta
OS Version: OS X 10.12.6
Flash Version:
 
Components: Blink>DataTransfer
Labels: Needs-Triage-M61
Cc: rbasuvula@chromium.org
Labels: Needs-Feedback
Tested in chrome # 61.0.3163.31,Canary #62.0.3180.0 on Mac 10.12.6 and able to reproduce the issue in Beta and not in Canary.Please find the screen shots for your reference.

@islam: Could you please let me know if i have missed anything and if possible,Please create new profile without extensions and apps.Re-check once in latest Canary(62.0.3180.0)and let us know the observations and expected behaviour of the issue which would help us to triage the issue further.

Thanks in Advance.
753612.png
224 KB View Download
@rbasuvula, I think my bug report wasn't super clear, the expected output is to have "copying <random number>" and then when you paste "yoyoma: <random number>". So in the screenshot you added of canary, that looks to reproduce the bug

For reference I'm adding a screenshot of chrome 60 expected output.

I just retested in 60, Beta (61.0.3163.31), and Canary (62.0.3180.0) -- I can reproduce in both beta and canary.
chrome-60-expected.png
861 KB View Download
Also note that you don't need to select the next in the lower right quadrant, I just want to make sure it had focus.
Project Member

Comment 6 by sheriffbot@chromium.org, Aug 9 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "rbasuvula@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: M-62 OS-Linux OS-Windows
Owner: a...@chromium.org
Status: Assigned (was: Unconfirmed)
Thanks for the update!
Tested in chrome Beta #61.0.3163.31 and canary #62.0.3181.0 on Mac 10.12.6,Ubuntu 14.04 & Win 10.0 able to reproduce the issue.
Below are the Bisect Details:

Bisect Info:
------------
Good Build: 61.0.3142.0(Revision - 482491)
Bad Build: 61.0.3143.0(Revision - 482834)

You are probably looking for a change made after 482625 (known good), but no later than 482626 (first known bad).

CHANGELOG URL:
https://chromium.googlesource.com/chromium/src/+log/997b71924f38eb831ba87cf97a07371100715268..56f9a641544d2cafa37142545bb39254f7bd98b3

From the CL above, assigning the issue to the concern owner

@avi: Could you please look into the issue, pardon me if it has nothing to do with your changes and if possible please assign it to concern owner.

Review-Url:  https://codereview.chromium.org/2957923002
Project Member

Comment 8 by bugdroid1@chromium.org, Aug 10 2017

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

commit 8b750849271adebe4dc164d1101ccaaa3790f922
Author: Avi Drissman <avi@chromium.org>
Date: Thu Aug 10 21:18:26 2017

Revert "Don't count browser shortcut events as being user gestures."

This reverts commit 56f9a641544d2cafa37142545bb39254f7bd98b3.

The lack of a user gesture for browser shortcut events causes web
compatibility issues. This needs a better-engineered approach.

BUG=709765,  749005 ,  753612 ,  741612 
TEST=as in bugs

Change-Id: I2faee9623597561297e01756b4bdf6f56c049eeb
Reviewed-on: https://chromium-review.googlesource.com/610829
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#493549}
[modify] https://crrev.com/8b750849271adebe4dc164d1101ccaaa3790f922/third_party/WebKit/Source/core/input/KeyboardEventManager.cpp

Comment 9 by a...@chromium.org, Aug 10 2017

Calling this fixed; asking for a merge to 61 on a different bug.

Comment 10 by a...@chromium.org, Aug 10 2017

Status: Fixed (was: Assigned)
Project Member

Comment 11 by bugdroid1@chromium.org, Aug 11 2017

Labels: merge-merged-3163
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0234225c87bd459b2039d642921e9a7ad502eb89

commit 0234225c87bd459b2039d642921e9a7ad502eb89
Author: Avi Drissman <avi@chromium.org>
Date: Fri Aug 11 17:35:51 2017

Revert "Don't count browser shortcut events as being user gestures."

This reverts commit 56f9a641544d2cafa37142545bb39254f7bd98b3.

The lack of a user gesture for browser shortcut events causes web
compatibility issues. This needs a better-engineered approach.

BUG=709765,  749005 ,  753612 ,  741612 
TEST=as in bugs
TBR=avi@chromium.org

Change-Id: I2faee9623597561297e01756b4bdf6f56c049eeb
Reviewed-on: https://chromium-review.googlesource.com/610829
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#493549}(cherry picked from commit 8b750849271adebe4dc164d1101ccaaa3790f922)
Reviewed-on: https://chromium-review.googlesource.com/611668
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/branch-heads/3163@{#490}
Cr-Branched-From: ff259bab28b35d242e10186cd63af7ed404fae0d-refs/heads/master@{#488528}
[modify] https://crrev.com/0234225c87bd459b2039d642921e9a7ad502eb89/third_party/WebKit/Source/core/input/KeyboardEventManager.cpp

Labels: Needs-Feedback
Tested the issue on Windows-7, Ubuntu 14.04 and Mac OS 10.12 using chrome latest Beta M61-61.0.3163.49 by following steps mentioned in the original comment. Observed that issue is working fine in mac but able to reproduce in Windows and Linux.Please find the screen shot for reference.

@avi: Could you please check the attached screen shot and let me know if i have missed anything and if possible,Please provide the windows and Linux behaviour of the issue which would help us to verify the issue further.

Thanks in Advance.

753612..png
453 KB View Download

Comment 13 by a...@chromium.org, Aug 16 2017

That test page was Mac-only.

If you alter the test page's onKeyDown event to say:

function onKeyDown(event) {
  console.log('keydown', event)
  event.preventDefault()
  event.stopPropagation()
  if (event.key == 'c' && (event.metaKey || event.ctrlKey)) {
    copy()  
  }
}

you will see that it works on Windows/Linux now too.
Note sure this is correct behavior but here is what I am seeing when I updated the test page with comment#13 

Steps to reproduce the problem:
1. Open this jsfiddle: https://jsfiddle.net/a469yLz5/(changed function onKeyDown(event) as per comment#13)
2. Open dev tools console
3. Click in the frame on the lower right
4. Press "cmd+c"


Observed behavior on JS console on Windows and Linux:
keydown KeyboardEvent {isTrusted: true, key: "Control", code: "ControlLeft", location: 1, ctrlKey: true, …}
(index):62 keydown KeyboardEvent {isTrusted: true, key: "Control", code: "ControlLeft", location: 1, ctrlKey: true, …}
(index):62 keydown KeyboardEvent {isTrusted: true, key: "c", code: "KeyC", location: 0, ctrlKey: true, …}
(index):56 called copy
(index):50 copying 0.7327771430398045

@pbomm that is the correct behavior

Sign in to add a comment