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

Issue 2541153004: Keep caret show around non-editable element under editable element

Created:
4 years ago by joone
Modified:
4 years ago
Reviewers:
yosin_UTC9
CC:
blink-reviews, chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Keep caret show around non-editable element under editable element contenteditable would lose selection near inline non-editable element so this CL allows to return the last editable position in order not to lose the selection. Here is an example: <div contenteditable>editable1 <i contenteditable=false>readonly1</i></div> <div contenteditable>editable2 <i contenteditable=false>readonly2</i></div> <div>readonly3</div> When we move the selection from the end of the text node("editable "), the selection is located in the third div and then the caret is disappeared. BUG=669229 TEST=editing/selection/move-cursor-over-uneditable-in-contenteditable.html

Patch Set 1 #

Patch Set 2 : add test case #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+21 lines, -0 lines) Patch
A third_party/WebKit/LayoutTests/editing/selection/move-cursor-over-uneditable-in-contenteditable.html View 1 1 chunk +15 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/EditingUtilities.cpp View 1 chunk +6 lines, -0 lines 1 comment Download

Messages

Total messages: 13 (11 generated)
joone
Hi yosin@ could you review this CL? I'm trying to fix the fail in EditingUtilitiesTest.firstEditablePositionAfterPositionInRoot ...
4 years ago (2016-12-07 03:13:00 UTC) #12
yosin_UTC9
4 years ago (2016-12-07 05:07:15 UTC) #13
https://codereview.chromium.org/2541153004/diff/40001/third_party/WebKit/Sour...
File third_party/WebKit/Source/core/editing/EditingUtilities.cpp (right):

https://codereview.chromium.org/2541153004/diff/40001/third_party/WebKit/Sour...
third_party/WebKit/Source/core/editing/EditingUtilities.cpp:624: if
(!isEditablePosition(editablePosition))
I think we should revise implementation of this function.

This function should be:

for (Position runner = position; runner is in highestRoot; runner =
nextPosition(runner)) {
  if (runner is editable)
    return runner;
}
return none; // there is no editable position after |position|.


Visible position canonicalization is due by caller rather than this function.

Powered by Google App Engine
This is Rietveld 408576698