[editing] Avoid CHECK failure in CreateMarkupAlgorithm::CreateMarkup
CompositeEditCommand::MoveParagraphs has a start and end positions, and constrains them with Most{Forward,Backward}CaretPosition. The problem was that the resulting positions could end up reversed, triggering a CHECK failure in CreateMarkup. This patch changes CompositeEditCommand::MoveParagraphs so that it only attempts to contrain the positions if they are different, and also changes MostBackwardOrForwardCaretPosition to ensure that the shadow- adjusted candidate is not further from the initial position than the non-adjusted candidate. Bug: 1165325 TEST=CompositeEditCommandTest.MoveParagraphContentsToNewBlockWithUAShadowDOM TEST=SelectionAdjusterTest.AdjustSelectionTypeWithShadow TEST=VisibleSelectionTest.ShadowCrossing TEST=VisibleSelectionTest.ShadowNested Change-Id: Ib52ed472809e15aa551fdfc4ed1fa2323433d4cb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2627368 Commit-Queue: Yoshifumi Inoue <yosin@chromium.org> Reviewed-by:Yoshifumi Inoue <yosin@chromium.org> Cr-Commit-Position: refs/heads/master@{#843406}
Showing
Please register or sign in to comment