Issue metadata
Sign in to add a comment
|
document.queryCommandEnabled("copy") returns a false negative when nothing is selected. |
||||||||||||||||||||||
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
,
Oct 5 2016
|
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by lgar...@chromium.org
, Sep 23 201696 bytes
96 bytes View Download