We should pass proper range to TextIterator constructor |
|||
Issue descriptionIt is not good design that TextIterator constructor can start > end range. Following layout tests calls TextIterator ctor with start > end: - editing/spelling/spellcheck-queue.html SpellChecker::MarkAndReplaceFor() -> TextCheckingParagraph::OffsetTo() - editing/spelling/spellcheck-async-mutation.html SpellChecker::MarkAndReplaceFor() -> TextCheckingParagraph::OffsetTo() - editing/selection/shift-click.html SelectionController::HandleSingleClick() => TextDistance() - editing/selection/user-select-all-with-shift.html SelectionController::HandleSingleClick() => TextDistance()
,
May 31 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/0711a0a702c23b484eadb514070f20f58b97bb35 commit 0711a0a702c23b484eadb514070f20f58b97bb35 Author: yosin <yosin@chromium.org> Date: Wed May 31 01:11:19 2017 Make SelectionController to call TextDistance() with proper range This patch changes |SelectionController::HandleSingleClick()| to call |TextDistance()|, which constructs |TextIterator| via |RangeLength()| with proper range, start <= end, as preparation of making |TextIterator| constructor to take only proper range[1]. [1] http://crrev.com/2912053002: Call TextIterator constructor with proper range BUG=727537 TEST=n/a; no behavior changes Review-Url: https://codereview.chromium.org/2912923002 Cr-Commit-Position: refs/heads/master@{#475717} [modify] https://crrev.com/0711a0a702c23b484eadb514070f20f58b97bb35/third_party/WebKit/Source/core/editing/SelectionController.cpp
,
May 31 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9a241f0157e83c8defd3ee25b06232f6688bf86b commit 9a241f0157e83c8defd3ee25b06232f6688bf86b Author: yosin <yosin@chromium.org> Date: Wed May 31 01:16:00 2017 Expand TextCheckingParagraph::OffsetTo() into SelectionController::MarkAndReplaceFor() This patch expands |TextCheckingParagraph::OffsetTo()| into |SelectionController::MarkAndReplaceFor()| with optimizations, see below, because it is called once for improving code health. Since |TextCheckingParagraph| object |paragraph| holds single range |checking_range|, we can hold |TextCheckingParagraph::OffsetAsRange().StartPosition()| to |checking_range.StartPosition()|. When |caret_position < paragraph_start|, we don't need to consider it, because of caret is placed before checked range. This patch is a preparation of patch[1]. [1] http://crrev.com/2912053002: Call TextIterator constructor with proper range BUG=727537 TEST=n/a; no behavior changes Review-Url: https://codereview.chromium.org/2909923005 Cr-Commit-Position: refs/heads/master@{#475718} [modify] https://crrev.com/9a241f0157e83c8defd3ee25b06232f6688bf86b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp [modify] https://crrev.com/9a241f0157e83c8defd3ee25b06232f6688bf86b/third_party/WebKit/Source/core/editing/spellcheck/TextCheckingParagraph.cpp [modify] https://crrev.com/9a241f0157e83c8defd3ee25b06232f6688bf86b/third_party/WebKit/Source/core/editing/spellcheck/TextCheckingParagraph.h
,
May 31 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/984f4b2c4df57ae840917a1d79f95a54e68e2c7b commit 984f4b2c4df57ae840917a1d79f95a54e68e2c7b Author: yosin <yosin@chromium.org> Date: Wed May 31 06:00:29 2017 Make TextIterator constructor to take only proper range This patch makes |TextIterator| constructor to take only proper range to simplify code for improve code health. Note: This patch is passed all tests, but there are some cases to pass improper range to |TextIterator|. To catch such case and avoid infinite loop, we use |CHECK()| to make blink crash. BUG=727537 TEST=n/a; no behavior changes Review-Url: https://codereview.chromium.org/2912053002 Cr-Commit-Position: refs/heads/master@{#475819} [modify] https://crrev.com/984f4b2c4df57ae840917a1d79f95a54e68e2c7b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
,
May 31 2018
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jun 4 2018
|
|||
►
Sign in to add a comment |
|||
Comment 1 by yosin@chromium.org
, May 30 2017