pasting text in online editor even when not in focus
Reported by
adam.yza...@gmail.com,
Aug 15 2017
|
|||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36 Steps to reproduce the problem: 1. go to https://ace.c9.io/build/kitchen-sink.html 2. Select text from inside the editor and press CTRL-C. 3. Press one of the checkboxes on the left 4.**Editor loses focus*** 5.Press CTRL-V What is the expected behavior? Nothing should happen What went wrong? the text is copied from the clipboard to the editor. This Doesn't happen in IE and Firefox. Did this work before? N/A Chrome version: 60.0.3112.90 Channel: n/a OS Version: 10.0 Flash Version: This effects other online editor. ace editor is just an example.
,
Aug 16 2017
,
Aug 17 2017
chrome-actual result firefox- expected result. thx. couldnt see if you used ctrl-v after checking a checkbox.
,
Aug 17 2017
Thank you for providing more feedback. Adding requester "hdodda@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Sep 5 2017
Able to reproduce on Mac OS 10.12.6, Ubuntu 14.04 and windows-10 using chrome latest stable #60.0.3112.113 Bisect Information: ----------------------- Good build: 59.0.3071.132 Bad Build : 60.0.3072.0 You are probably looking for a change made after 464697 (known good), but no later than 464698 (first known bad). Change Log URL: https://chromium.googlesource.com/chromium/src/+log/188c1056bbfb9c98eca691c12f5641d4204f6066..0f65d25a4097959d977dbb1077717323438240a6 From the above change log suspecting the same hugoh@ - Could you please check whether this is caused with respect to your change, if not please help us in assigning it to the right owner.
,
Sep 11 2017
Hi Adam! Thanks for your bug report. Do you know of a smaller test case that triggers this?
,
Oct 2 2017
adam.yzamri@, do you still see this problem?
,
Oct 11 2017
Does it repro in M61? r472985 should have disabled pasting without focus, which is effective since M61.
,
Oct 30 2017
brajkumar@, could you re-verify this?
,
Nov 14 2017
Sorry for the late reply. Yes, still able to reproduce this issue on Ubuntu 14.04 using chrome latest stable #62.0.3202.89. Thanks!
,
Nov 27 2017
I see one difference between Chrome and Firefox:
Chrome sends a paste-event to the <textarea> even though it doesn't have focus.
Minimal repro:
<input type="checkbox">
<textarea cols=40 rows=30>text here</textarea>
<p id="log"></p>
<script>
var count = 0;
var logPaste = function() {
var log = document.getElementById("log");
log.innerHTML = "Textarea got " + ++count + " paste-events!";
}
var textArea = document.querySelector("textarea");
textArea.addEventListener("paste", logPaste);
</script>
1. Focus <textarea>.
2. Focus checkbox.
3. Paste some text with CTRL+V.
Actual: <textarea> gets a paste-event (but no text is pasted).
Expected (?): <textarea> gets no paste-events (and no text is pasted).
,
Nov 30 2017
Fix up for review: https://chromium-review.googlesource.com/c/chromium/src/+/799697
,
Dec 13 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/adad191b2de61531d8043a3ad2a4c717a66801e9 commit adad191b2de61531d8043a3ad2a4c717a66801e9 Author: Hugo Holgersson <hugoh@vewd.com> Date: Wed Dec 13 17:55:56 2017 For readability, refactor some of blink::Editor's methods This patch does not change any web facing logic. Only private methods are changed, the public API is untouched. Renamed methods: DispatchCPPEvent -> DispatchClipboardEvent TryDHTMLCopy -> DispatchCopyEvent TryDHTMLCut -> DispatchCutEvent TryDHTMLPaste -> DispatchPasteEvent These methods now return false upon preventDefault() from JavaScript. Before this change, only the first method followed this convention. Bug: 755459 Change-Id: I2b9dd77b0c0cd6a2ad29136e1ec2f9dec7d37622 Reviewed-on: https://chromium-review.googlesource.com/810806 Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org> Commit-Queue: Hugo Holgersson <hugoh@vewd.com> Cr-Commit-Position: refs/heads/master@{#523810} [modify] https://crrev.com/adad191b2de61531d8043a3ad2a4c717a66801e9/third_party/WebKit/Source/core/editing/Editor.cpp [modify] https://crrev.com/adad191b2de61531d8043a3ad2a4c717a66801e9/third_party/WebKit/Source/core/editing/Editor.h
,
Dec 14 2017
Verified this issue on Windows-10, Ubuntu 14.04 and Mac OS 10.12.6 using chrome latest dev #65.0.3294.0 by following steps mentioned in the original comment. Observed the editor loses the focus and unable to paste the text in the editor as expected. Hence adding TE-Verified label for M65. Thanks!
,
Dec 14 2017
This is not yet fixed. The fix (at #12) has not yet landed. Maybe you couldn't reproduce it anymore because https://ace.c9.io/build/kitchen-sink.html changed in some way. When I try that page on ToT, I don't manage to paste at all, even when the editor has focus. Please try the stable reproduction steps from #11.
,
Dec 15 2017
Re #14, #15. Ace Editor's copy/paste still works in stable Chrome so the page itself has not regressed. The regression is on master, see crbug.com/795212 .
,
Dec 15 2017
,
Dec 19 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/4984f824b38645f904645e192b48c6c7b5cd37c6 commit 4984f824b38645f904645e192b48c6c7b5cd37c6 Author: Hugo Holgersson <hugoh@vewd.com> Date: Tue Dec 19 14:55:01 2017 Do not target hidden selections with ClipboardEvents In Chrome a selection can have 3 states: - Focused (and visible) - Visible but unfocused - Hidden (NEW*) The spec** currently says: "Set target to be the element that contains the start of the selection in document order, or the body element if there is no selection or cursor." This CL treats hidden selections as "no selection or cursor" (document.body is targeted). Target: State: | Focused | Visible but unfocused | Hidden --------------------- ------------------------------------ Copy | VS | VS | BODY Cut&Paste | VS | VS | BODY VS = Visible Selection. * https://github.com/w3c/selection-api/issues/94 ** https://www.w3.org/TR/clipboard-apis/#fire-a-clipboard-event The spec is being updated in: https://github.com/w3c/clipboard-apis/issues/57 Bug: 755459 Change-Id: I62670944ca0a636f9530e9857fde9e68044c44bc Reviewed-on: https://chromium-review.googlesource.com/799697 Commit-Queue: Hugo Holgersson <hugoh@vewd.com> Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org> Cr-Commit-Position: refs/heads/master@{#525029} [add] https://crrev.com/4984f824b38645f904645e192b48c6c7b5cd37c6/third_party/WebKit/LayoutTests/editing/pasteboard/clipboard-event-targets-visible-unfocused-selection.html [add] https://crrev.com/4984f824b38645f904645e192b48c6c7b5cd37c6/third_party/WebKit/LayoutTests/editing/pasteboard/no-clipboard-event-to-hidden-selection.html [modify] https://crrev.com/4984f824b38645f904645e192b48c6c7b5cd37c6/third_party/WebKit/Source/core/editing/Editor.cpp [modify] https://crrev.com/4984f824b38645f904645e192b48c6c7b5cd37c6/third_party/WebKit/Source/core/editing/Editor.h [modify] https://crrev.com/4984f824b38645f904645e192b48c6c7b5cd37c6/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
,
Dec 20 2017
|
|||||||||||
►
Sign in to add a comment |
|||||||||||
Comment 1 by hdodda@chromium.org
, Aug 16 2017Labels: Needs-Feedback
1.6 MB
1.6 MB View Download