New issue
Advanced search Search tips

Issue 649820 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue 542948
Owner:
Closed: Oct 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

document.queryCommandEnabled("copy") returns a false negative when nothing is selected.

Project Member Reported by lgar...@chromium.org, Sep 23 2016

Issue description

Chrome 55.0.2859.0
OSX 10.11.6

What steps will reproduce the problem?
1. Open `queryCommandEnabled.html` and open the console.
2. Click the button.
3. Highlight the text and click the button.

What is the expected output?
document.queryCommandEnabled('copy') logs `true` in both cases.

What is the expected output?
2. `false`
3. `true`

This one's a bit weird.
Firefox: 2. true 3. true
Chrome, Opera: 2. fase 3. true
Safari: 2. false 3. false [1]
Firefox matches the expected behaviours.

Reading [2] from the perspective of a normal developer suggests the correct value should be `true`, but the specification draft link on that page is broken, and following a link to [3] leads to a spec with an aggressive warning that it will not advance beyond draft status. ¯\_(ツ)_/¯

All the more reason to implement a sane clipboard API ( Issue 593475 ).

queryCommandEnabled.html source:

  Some text
  <button onclick="console.log(document.queryCommandEnabled('copy'));">Click me</button>

[1] https://bugs.webkit.org/show_bug.cgi?id=156529
[2] https://developer.mozilla.org/en-US/docs/Web/API/Document/queryCommandEnabled
[3] https://w3c.github.io/editing/execCommand.html

 
Downloadable repro file for convenience.
queryCommandEnabled.html
96 bytes View Download
Mergedinto: 542948
Status: Duplicate (was: Assigned)
Yeah, we should fix this =)

Sign in to add a comment