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

Unified Diff: third_party/WebKit/Source/core/editing/EditingUtilities.cpp

Issue 2541153004: Keep caret show around non-editable element under editable element
Patch Set: add test case Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/editing/selection/move-cursor-over-uneditable-in-contenteditable.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/EditingUtilities.cpp
diff --git a/third_party/WebKit/Source/core/editing/EditingUtilities.cpp b/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
index 60ef9c2598a6be301ff403ab218034e448a039c1..070d99679075ca3319991cb4bdbe3017d4dd7adc 100644
--- a/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
+++ b/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
@@ -618,6 +618,12 @@ PositionTemplate<Strategy> firstEditablePositionAfterPositionInRootAlgorithm(
if (nonEditableNode &&
nonEditableNode->isDescendantOf(editablePosition.anchorNode()))
editablePosition = nextVisuallyDistinctCandidate(editablePosition);
+
+ // if |editablePosition| is not editable, return the last editable position.
+ // See http://crbug.com/669229.
+ if (!isEditablePosition(editablePosition))
yosin_UTC9 2016/12/07 05:07:15 I think we should revise implementation of this fu
+ return PositionTemplate<Strategy>(&highestRoot, 1);
+
return editablePosition;
}
« no previous file with comments | « third_party/WebKit/LayoutTests/editing/selection/move-cursor-over-uneditable-in-contenteditable.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698