New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 813416 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Hidden selections can be copied

Reported by hu...@vewd.com, Feb 18 2018

Issue description

<input value="hey"></input>
<input type="checkbox">

What steps will reproduce the problem?
(1) Select "hey".
(2) Use TAB-key to move focus to the checkbox.
(3) CTRL+C.

What is the expected result?
HEY is not copied.

What happens instead?
HEY is copied.
 
Project Member

Comment 2 by bugdroid1@chromium.org, Feb 19 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0a9dcf3d5aa4e5de4ac65b40fb7f85ebfc168eb6

commit 0a9dcf3d5aa4e5de4ac65b40fb7f85ebfc168eb6
Author: Hugo Holgersson <hugoh@vewd.com>
Date: Mon Feb 19 12:34:44 2018

Don't copy hidden selections

Chrome sometimes hides selections*. CTRL+C should not copy
such selections because users expect that CTRL+C has no
effect when their browser doesn't display a selection.

What about cut and paste?
Cut and paste are read/write-operations so they only operate
on _focused_ selections. A focused selection is always visible:

  bool FrameSelection::IsHidden() const {
    if (SelectionHasFocus())
      return false;
    ...

=> Cut and paste already follow the principle of visibility
so we only need to fix "copy". This CL does that.

* See the explainer in crrev.com/525029 for more information.

Bug:  813416 
Change-Id: Ibb5f3868e7a5fc37c7522bb753a41ae9568d98e2
Reviewed-on: https://chromium-review.googlesource.com/924027
Commit-Queue: Hugo Holgersson <hugoh@vewd.com>
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537633}
[modify] https://crrev.com/0a9dcf3d5aa4e5de4ac65b40fb7f85ebfc168eb6/third_party/WebKit/Source/core/editing/Editor.cpp
[modify] https://crrev.com/0a9dcf3d5aa4e5de4ac65b40fb7f85ebfc168eb6/third_party/WebKit/Source/core/editing/EditorTest.cpp

Comment 3 by hu...@vewd.com, Feb 19 2018

Status: Fixed (was: Started)

Sign in to add a comment