Chrome Version: 55.0.2883.95
OS: macOS 10.12.2 (but should be All)
What steps will reproduce the problem?
(1) Go to https://jsbin.com/zezowoz
(2) Select "123"
(3) Hit backspace key on keyboard
(4) Observe result
What is the expected result?
"123" get deleted and "Barrier" stays.
What happens instead?
Both "123" and "Barrier" are deleted.
The root cause is:
1. Blink calls |CompositeEditCommand::removeNodePreservingChildren()| after deleting selection;
2. |removeNodePreservingChildren()| tries to removed <div>s with no siblings & no attributes (children will be deleted & re-attached to parent);
3. The child with "<style>* {-webkit-user-modify: read-write;}</style>" got deleted but failed to be re-inserted as the parent has lost editable attribute right after the deletion.
We need to decided what should be the appreciate behavior:
1. Keep current behavior
* Reasoning: We should insert node to non-editable containers
2. Force re-attaching children during |removeNodePreservingChildren()|
* Reasoning: Good for UX
3. Don't call |removeNodePreservingChildren()| if children contains "-webkit-user-modify" style
* Reasoning: Good for UX and might be less harmful than 2
Notes:
This also caused crash on issue 675727 .
|
Deleted:
deleting-123-removes-all.html
108 bytes
|
Comment 1 by yoichio@chromium.org
, Jan 12 2017