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

Issue 2894473003: Fix behavior of clipboard commands when there is unfocused selection (Closed)

Created:
3 years, 7 months ago by Xiaocheng
Modified:
3 years, 7 months ago
Reviewers:
tkent, yosin_UTC9
CC:
blink-reviews, chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix behavior of clipboard commands when there is unfocused selection User-triggered clipboard commands should be disabled when selection doesn't have focus. Hence, this patch checks whether selection has focus in EnabledCopy/Cut/Paste. However, this is a quirk that allows clipboard commands to run even their enabled functions return false, so that clipboard events are still fired regardless of the enabled state. To work with this quirk, this patch also checks whether selection has focus in Editor::Copy/Cut/Paste/PasteAsPlainText, and if not, stops the command. BUG=722925 TEST=editing/pasteboard/pasteboard_with_unfocused_selection.html Review-Url: https://codereview.chromium.org/2894473003 Cr-Commit-Position: refs/heads/master@{#472985} Committed: https://chromium.googlesource.com/chromium/src/+/f8ff4f535ca35569ff840d9ffb71bb3e9e5d3ee1

Patch Set 1 #

Patch Set 2 : Wed May 17 15:59:09 PDT 2017 #

Patch Set 3 : Fix UnsafeSVGAttributeSanitizationTest #

Unified diffs Side-by-side diffs Delta from patch set Stats (+182 lines, -3 lines) Patch
A third_party/WebKit/LayoutTests/editing/pasteboard/pasteboard_with_unfocused_selection.html View 1 1 chunk +139 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/Editor.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/Editor.cpp View 1 5 chunks +31 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp View 3 chunks +10 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/svg/UnsafeSVGAttributeSanitizationTest.cpp View 1 2 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 28 (19 generated)
Xiaocheng
PTAL.
3 years, 7 months ago (2017-05-18 00:06:19 UTC) #6
yosin_UTC9
lgtm This patch changes behavior of menu or keybinding case. Document#execCommand() called by UI event ...
3 years, 7 months ago (2017-05-18 01:12:37 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2894473003/20001
3 years, 7 months ago (2017-05-18 01:14:56 UTC) #12
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/458440)
3 years, 7 months ago (2017-05-18 03:10:35 UTC) #14
Xiaocheng
Whoops. Unit tests should also be modified...
3 years, 7 months ago (2017-05-18 03:22:43 UTC) #15
Xiaocheng
+tkent for core/svg
3 years, 7 months ago (2017-05-18 03:31:38 UTC) #18
tkent
lgtm
3 years, 7 months ago (2017-05-18 23:38:00 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2894473003/40001
3 years, 7 months ago (2017-05-19 00:03:50 UTC) #25
commit-bot: I haz the power
3 years, 7 months ago (2017-05-19 00:12:36 UTC) #28
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/f8ff4f535ca35569ff840d9ffb71...

Powered by Google App Engine
This is Rietveld 408576698