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

Issue 1668453002: Make empty selection behavior behave like Android EditText. (Closed)

Created:
4 years, 10 months ago by aelias_OOO_until_Jul13
Modified:
4 years, 10 months ago
Reviewers:
Ted C, yosin_UTC9
CC:
blink-reviews, Changwan Ryu, chromium-reviews, darin-cc_chromium.org, hush (inactive), jam
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make empty selection behavior behave like Android EditText. 1) When long-pressing a whitespace region in text field, the Android convention is to select zero characters and show an insertion handle (as opposed to the current behavior of selecting some whitespace and showing two selection handles). One important consequence of this is that insertion handles only show a "Paste" menu item, instead of the full suite of Cut/Copy/etc. I just needed to remove the unnecessary exclusion of editable nodes on the preexisting logic. 2) When single-tapping elsewhere, Paste popups should be cleared along with the insertion handle. Otherwise the paste menu keeps following the cursor around and is difficult to get rid of. This is a preexisting bug made much more common by change 1. 3) When the insertion handle is dragged, I noticed EditText brings back the Paste menu, so also add a few lines of code to do that. (Some state was already kept to support the "tap the handle to hide Paste/tap it again to show Paste" behavior, so I just reused that.) BUG=582628 Committed: https://crrev.com/1f5f2cacd588280568c40faa88a6dfdfaa867976 Cr-Commit-Position: refs/heads/master@{#373606}

Patch Set 1 #

Patch Set 2 : Fix compile error in WebViewTest #

Total comments: 1

Patch Set 3 : Apply code review and fix test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+53 lines, -8 lines) Patch
M content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java View 3 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/SelectionController.cpp View 1 2 1 chunk +6 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/web/tests/WebViewTest.cpp View 1 2 1 chunk +16 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/web/tests/data/longpress_textarea.html View 1 2 1 chunk +24 lines, -0 lines 0 comments Download

Messages

Total messages: 13 (6 generated)
aelias_OOO_until_Jul13
PTAL, yosin@ for core/editing tedchoc@ for ContentViewCore.java
4 years, 10 months ago (2016-02-03 05:57:51 UTC) #4
yosin_UTC9
lgtm for core/editing https://codereview.chromium.org/1668453002/diff/20001/third_party/WebKit/Source/core/editing/SelectionController.cpp File third_party/WebKit/Source/core/editing/SelectionController.cpp (right): https://codereview.chromium.org/1668453002/diff/20001/third_party/WebKit/Source/core/editing/SelectionController.cpp#newcode310 third_party/WebKit/Source/core/editing/SelectionController.cpp:310: String str = plainText(range, TextIteratorDefaultBehavior); nit: ...
4 years, 10 months ago (2016-02-03 06:49:28 UTC) #5
aelias_OOO_until_Jul13
Done, just need ContentViewCore review.
4 years, 10 months ago (2016-02-04 03:58:56 UTC) #6
Ted C
lgtm
4 years, 10 months ago (2016-02-04 18:48:50 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1668453002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1668453002/40001
4 years, 10 months ago (2016-02-04 19:13:24 UTC) #10
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 10 months ago (2016-02-04 20:30:34 UTC) #11
commit-bot: I haz the power
4 years, 10 months ago (2016-02-04 20:31:39 UTC) #13
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/1f5f2cacd588280568c40faa88a6dfdfaa867976
Cr-Commit-Position: refs/heads/master@{#373606}

Powered by Google App Engine
This is Rietveld 408576698