Fix document.queryCommandEnabled('cut'/'copy') to return true always

RESOLVED FIXED in Firefox 41

Status

()

defect
RESOLVED FIXED
4 years ago
2 months ago

People

(Reporter: Ehsan, Assigned: Nika)

Tracking

(Depends on 3 bugs, {dev-doc-complete})

unspecified
mozilla41
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox41 fixed)

Details

Attachments

(1 attachment, 3 obsolete attachments)

We should probably return false for now for paste as opposed to throwing when IsEditingOnAfterFlush() returns false.
While you're looking at and thinking of this, comments on the (feas|desir)ability of https://github.com/w3c/clipboard-apis/issues/4 would be very welcome ;)
(In reply to Hallvord R. M. Steen [:hallvors] from comment #1)
> While you're looking at and thinking of this, comments on the
> (feas|desir)ability of https://github.com/w3c/clipboard-apis/issues/4 would
> be very welcome ;)

See bug 596764.  :-)
(Assignee)

Updated

4 years ago
Blocks: 1012662
(Assignee)

Updated

4 years ago
See Also: → 1161721
(Assignee)

Updated

4 years ago
Duplicate of this bug: 1161721
(Assignee)

Comment 5

4 years ago
Acknowledge now-failing browserscope tests
Attachment #8604214 - Attachment is obsolete: true
Attachment #8604214 - Flags: review?(ehsan)
Attachment #8604327 - Flags: review?(ehsan)
Comment on attachment 8604327 [details] [diff] [review]
Always return true from document.queryCommandEnabled('cut'/'copy')

Review of attachment 8604327 [details] [diff] [review]:
-----------------------------------------------------------------

::: editor/libeditor/tests/test_bug408231.html
@@ +25,2 @@
>        ["createlink", "true"],
> +      ["cut", "true"],

Can you please uncomment and fix the test for paste further down this array?
Attachment #8604327 - Flags: review?(ehsan) → review+
(Assignee)

Comment 7

4 years ago
Un-commented and fixed queryCommandEnabled() test for 'paste'.

The other tests for paste aren't fixed by this patch (they throw).
Attachment #8604327 - Attachment is obsolete: true
(Assignee)

Updated

4 years ago
Attachment #8605330 - Flags: review?(ehsan)
Attachment #8605330 - Flags: review?(ehsan) → review+
One moment.. did we consider returning "true" only in a thread that's user-triggered (i.e. allowed to open a popup) and "false" otherwise?
Flags: needinfo?(ehsan)
(In reply to Hallvord R. M. Steen [:hallvors] from comment #8)
> One moment.. did we consider returning "true" only in a thread that's
> user-triggered (i.e. allowed to open a popup) and "false" otherwise?

Oh, thanks for noticing this.  Yes, we should definitely return false when we are not handling the user input.  Michael, do you mind making that change, please?
Flags: needinfo?(ehsan)
Comment on attachment 8605330 [details] [diff] [review]
Always return true from document.queryCommandEnabled('cut'/'copy')

r- as per comment 9.
Attachment #8605330 - Flags: review+ → review-
http://jsfiddle.net/213ov2ah/ tests queryCommandEnabled() for copy and cut - non-user-initiated and user-initiated.
(Assignee)

Comment 12

4 years ago
New patch which now only returns true when in privileged or user-initiated code.

New try in progress: https://treeherder.mozilla.org/#/jobs?repo=try&revision=8b6e1e3067e6
Attachment #8605330 - Attachment is obsolete: true
Attachment #8610170 - Flags: review?(ehsan)
Attachment #8610170 - Flags: review?(ehsan) → review+
(Assignee)

Updated

4 years ago
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/0431f570160d
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41

Updated

4 years ago
Depends on: 1178047
Depends on: 1211191

Updated

2 years ago
Depends on: 1327385

Updated

2 years ago
Depends on: 1327828

Updated

2 years ago
Depends on: 1328027

Updated

2 years ago
Depends on: 1328028

Updated

2 years ago
Depends on: 1328029

Updated

2 years ago
Depends on: 1271897
Component: DOM → DOM: Core & HTML
Product: Core → Core
You need to log in before you can comment on or make changes to this bug.