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

Issue 594920 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Apr 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Backspace splits Emoji Sequences

Project Member Reported by drott@chromium.org, Mar 15 2016

Issue description

Backspacing in a contenteditable element which has emoji sequences (http://unicode.org/reports/tr51/#Emoji_Sequences) leads to the sequences being broken up, e.g. a family emoji broken up into its members, skin tone modifier sequences being broken up into modifier base and removed skin tone, etc. 

The expected behavior is to remove the whole sequence through one backspace keypress.

I'm attaching a video to illustrate the issue.

Assiging to yosin@, perhaps you can take a look.  Issue 593263  may be helpful, where an analogous problem for line breaking was solved.

 
emoji_sequence_backspace.m4v
2.5 MB Download

Comment 1 by drott@chromium.org, Mar 15 2016

emoji-edit.html
3.6 KB View Download

Comment 2 by yosin@chromium.org, Mar 15 2016

Cc: tkent@chromium.org
Cc: tkent@ for FYI, this is an one of example of complexity of backspace behavior even if plain text.

Comment 3 by nona@chromium.org, Mar 16 2016

Cc: yosin@chromium.org
Owner: nona@chromium.org
I'm going to take a look.
Project Member

Comment 4 by bugdroid1@chromium.org, Mar 29 2016

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

commit 112c661e776be3a9a3ba04c2de484d0687630e83
Author: nona <nona@chromium.org>
Date: Tue Mar 29 07:19:48 2016

Introduce BackspaceStateMachine

BackspaceStateMachine is for deleting complex unicode sequence by
backspace key event.  This CL only introduces surrogate pair handling.
Note that BackspaceStateMachine will be compiled, linked and tested but
not yet used in production with this CL.

BUG= 594920 
R=yosin

Review URL: https://codereview.chromium.org/1832343002

Cr-Commit-Position: refs/heads/master@{#383685}

[modify] https://crrev.com/112c661e776be3a9a3ba04c2de484d0687630e83/third_party/WebKit/Source/core/core.gypi
[add] https://crrev.com/112c661e776be3a9a3ba04c2de484d0687630e83/third_party/WebKit/Source/core/editing/BackspaceStateMachine.cpp
[add] https://crrev.com/112c661e776be3a9a3ba04c2de484d0687630e83/third_party/WebKit/Source/core/editing/BackspaceStateMachine.h
[add] https://crrev.com/112c661e776be3a9a3ba04c2de484d0687630e83/third_party/WebKit/Source/core/editing/BackspaceStateMachineTest.cpp

Project Member

Comment 6 by bugdroid1@chromium.org, Mar 31 2016

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

commit dfedcc28b89073b53d791cc51fa305c87e68567c
Author: nona <nona@chromium.org>
Date: Thu Mar 31 09:53:48 2016

Move state machines to state_machines subdir

This CL moves state machine related files to
core/editing/state_machines.

This CL also changes BackspaceStateMachine to be able to use same template
implementation for other state machine, e.g.
GraphemeBoundaryStateMachine.

This CL also replaces the Backspace implementation with
BackspaceStateMachine.

BUG= 594920 

Review URL: https://codereview.chromium.org/1839753005

Cr-Commit-Position: refs/heads/master@{#384235}

[modify] https://crrev.com/dfedcc28b89073b53d791cc51fa305c87e68567c/third_party/WebKit/Source/core/core.gypi
[delete] https://crrev.com/0bb70155953b439896dce29f2b093be1bda23c6c/third_party/WebKit/Source/core/editing/BackspaceStateMachine.cpp
[delete] https://crrev.com/0bb70155953b439896dce29f2b093be1bda23c6c/third_party/WebKit/Source/core/editing/BackspaceStateMachine.h
[delete] https://crrev.com/0bb70155953b439896dce29f2b093be1bda23c6c/third_party/WebKit/Source/core/editing/BackspaceStateMachineTest.cpp
[modify] https://crrev.com/dfedcc28b89073b53d791cc51fa305c87e68567c/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
[add] https://crrev.com/dfedcc28b89073b53d791cc51fa305c87e68567c/third_party/WebKit/Source/core/editing/state_machines/BackspaceStateMachine.cpp
[add] https://crrev.com/dfedcc28b89073b53d791cc51fa305c87e68567c/third_party/WebKit/Source/core/editing/state_machines/BackspaceStateMachine.h
[add] https://crrev.com/dfedcc28b89073b53d791cc51fa305c87e68567c/third_party/WebKit/Source/core/editing/state_machines/BackspaceStateMachineTest.cpp
[add] https://crrev.com/dfedcc28b89073b53d791cc51fa305c87e68567c/third_party/WebKit/Source/core/editing/state_machines/TextSegmentationMachineState.cpp
[add] https://crrev.com/dfedcc28b89073b53d791cc51fa305c87e68567c/third_party/WebKit/Source/core/editing/state_machines/TextSegmentationMachineState.h

Project Member

Comment 7 by bugdroid1@chromium.org, Apr 1 2016

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

commit 808548a16239bb307eae1d369595792f2d8cf277
Author: nona <nona@chromium.org>
Date: Fri Apr 01 07:35:08 2016

Implement backspace state machine for complex emoji sequence.

There are five types of complex emoji sequence as of Unicode 9.0
- Emoji + Variatino selector
- Emoji + Emoji modifier
- Keycap base + Keycap
- Regional indicator symbols
- ZWJ sequence

By this CL, BackspaceStateMachine can delete above emoji sequence
correctly.

BUG= 594920 

Review URL: https://codereview.chromium.org/1844663002

Cr-Commit-Position: refs/heads/master@{#384511}

[modify] https://crrev.com/808548a16239bb307eae1d369595792f2d8cf277/third_party/WebKit/Source/core/editing/state_machines/BackspaceStateMachine.cpp
[modify] https://crrev.com/808548a16239bb307eae1d369595792f2d8cf277/third_party/WebKit/Source/core/editing/state_machines/BackspaceStateMachine.h
[modify] https://crrev.com/808548a16239bb307eae1d369595792f2d8cf277/third_party/WebKit/Source/core/editing/state_machines/BackspaceStateMachineTest.cpp
[modify] https://crrev.com/808548a16239bb307eae1d369595792f2d8cf277/third_party/WebKit/Source/wtf/text/CharacterNames.h

Comment 8 by nona@chromium.org, Apr 1 2016

Status: Fixed (was: Assigned)

Comment 9 Deleted

What about ↕️↔️ keys, they can also move the cursor to the middle of an Emoji sequence.
Cc: n...@chromium.org

Comment 12 by nona@chromium.org, Apr 11 2016

> Comment10
I'm sorry for late reply. Cursor movement is also fixed.
Please see  http://crbug.com/594923 
Project Member

Comment 13 by bugdroid1@chromium.org, Apr 20 2016

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

commit d54a5cbde82b8238e55fcd1450c0d838acd9fab9
Author: nona <nona@chromium.org>
Date: Wed Apr 20 09:40:48 2016

Do not break after ZWJ if the trailing character is Emoji.

Vendor may want to introduce their own ZWJ sequence.
To handle any kind of ZWJ joiner sequence, do not break the
grapheme cluster after ZWJ. Similary, need to delete emoji
before and after ZWJ at the same time by single backspace key.

BUG= 594923 
BUG= 594920 

Review URL: https://codereview.chromium.org/1902553004

Cr-Commit-Position: refs/heads/master@{#388455}

[modify] https://crrev.com/d54a5cbde82b8238e55fcd1450c0d838acd9fab9/third_party/WebKit/Source/core/editing/EditingUtilitiesTest.cpp
[modify] https://crrev.com/d54a5cbde82b8238e55fcd1450c0d838acd9fab9/third_party/WebKit/Source/core/editing/state_machines/BackspaceStateMachine.cpp
[modify] https://crrev.com/d54a5cbde82b8238e55fcd1450c0d838acd9fab9/third_party/WebKit/Source/core/editing/state_machines/BackspaceStateMachineTest.cpp
[modify] https://crrev.com/d54a5cbde82b8238e55fcd1450c0d838acd9fab9/third_party/WebKit/Source/core/editing/state_machines/StateMachineUtil.cpp
[modify] https://crrev.com/d54a5cbde82b8238e55fcd1450c0d838acd9fab9/third_party/WebKit/Source/core/editing/state_machines/StateMachineUtilTest.cpp
[modify] https://crrev.com/d54a5cbde82b8238e55fcd1450c0d838acd9fab9/third_party/WebKit/Source/platform/text/Character.h
[modify] https://crrev.com/d54a5cbde82b8238e55fcd1450c0d838acd9fab9/third_party/WebKit/Source/platform/text/CharacterEmoji.cpp

Sign in to add a comment