Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Issue 1406713002: Make queryCommandSupported(copy|cut|paste) always return true (Closed)

Created:
5 years, 2 months ago by yosin_UTC9
Modified:
5 years, 2 months ago
CC:
blink-reviews, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make queryCommandSupported(copy|cut|paste) always return true This patch makes |document.queryCommandSupported(name)| always return true for "Copy", "Cut", and "Paste" commands to follow the editing API specification. Before this patch, |queryCommandSupported()| returns value based on clipboard accessibility, e.g. "clipboardRead" and "clipboardWrite" permission in Chrome extensions. This behavior ins't compatible with the editing specification and its intention. |queryCommandSupported()| should returns true for command which can be passed to |execCommand()|, and other |queryCommandXXX()|. Here is a table of return value of |execute()| and |isEnabled()| with clipboard access permission and Editor.canCopy/Cut/Paste Can R/W Editor.can isEnabled execute Clipboard Copy/Paste true true true true true false false true false true false false false false false false BUG=476508, 475868 TEST=LayoutTests/editing/pasteboard/copy-cut-paste-supported.html Committed: https://crrev.com/bf9013658c0eb493db5dd0941532160dc9fdd0c7 Cr-Commit-Position: refs/heads/master@{#354240}

Patch Set 1 #

Patch Set 2 : 2015-10-14T14:29:03 #

Patch Set 3 : 2015-10-14T16:00:41 #

Patch Set 4 : 2015-10-14T18:09:51 #

Patch Set 5 : 2015-10-14T18:29:33 #

Total comments: 6

Patch Set 6 : 2015-10-15T17:15:20 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+78 lines, -30 lines) Patch
A third_party/WebKit/LayoutTests/editing/pasteboard/copy-cut-paste-supported.html View 1 chunk +10 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp View 1 2 3 4 5 10 chunks +68 lines, -30 lines 0 comments Download

Messages

Total messages: 11 (3 generated)
yosin_UTC9
PTAL queryCommandSupported() for "copy", "cut", and "paste" doesn't related to queryCommandEnabled(). So, clipboard API doesn't ...
5 years, 2 months ago (2015-10-14 09:38:11 UTC) #2
dcheng
https://codereview.chromium.org/1406713002/diff/80001/third_party/WebKit/LayoutTests/editing/pasteboard/copy-cut-paste-supported.html File third_party/WebKit/LayoutTests/editing/pasteboard/copy-cut-paste-supported.html (right): https://codereview.chromium.org/1406713002/diff/80001/third_party/WebKit/LayoutTests/editing/pasteboard/copy-cut-paste-supported.html#newcode8 third_party/WebKit/LayoutTests/editing/pasteboard/copy-cut-paste-supported.html:8: assert_true(document.queryCommandSupported('paste')); Should we test queryCommandEnabled as well? Or is ...
5 years, 2 months ago (2015-10-14 16:47:38 UTC) #3
yosin_UTC9
PTAL Put reply comments. https://codereview.chromium.org/1406713002/diff/80001/third_party/WebKit/LayoutTests/editing/pasteboard/copy-cut-paste-supported.html File third_party/WebKit/LayoutTests/editing/pasteboard/copy-cut-paste-supported.html (right): https://codereview.chromium.org/1406713002/diff/80001/third_party/WebKit/LayoutTests/editing/pasteboard/copy-cut-paste-supported.html#newcode8 third_party/WebKit/LayoutTests/editing/pasteboard/copy-cut-paste-supported.html:8: assert_true(document.queryCommandSupported('paste')); On 2015/10/14 at 16:47:37, ...
5 years, 2 months ago (2015-10-15 01:30:47 UTC) #4
dcheng
lgtm, but let's add comments to make it clearer (even if it is going to ...
5 years, 2 months ago (2015-10-15 06:10:30 UTC) #5
yosin_UTC9
Thanks for reviewing! Committing... https://codereview.chromium.org/1406713002/diff/80001/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp File third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp (right): https://codereview.chromium.org/1406713002/diff/80001/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp#newcode309 third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp:309: if (!canWriteClipboard(frame, source)) On 2015/10/15 ...
5 years, 2 months ago (2015-10-15 08:18:55 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1406713002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1406713002/100001
5 years, 2 months ago (2015-10-15 08:19:11 UTC) #9
commit-bot: I haz the power
Committed patchset #6 (id:100001)
5 years, 2 months ago (2015-10-15 09:19:01 UTC) #10
commit-bot: I haz the power
5 years, 2 months ago (2015-10-15 09:20:09 UTC) #11
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/bf9013658c0eb493db5dd0941532160dc9fdd0c7
Cr-Commit-Position: refs/heads/master@{#354240}

Powered by Google App Engine
This is Rietveld 408576698