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

Issue 2925363002: Add SpellChecker::GetSpellCheckMarkerTouchingSelection() (Closed)

Created:
3 years, 6 months ago by rlanday
Modified:
3 years, 6 months ago
Reviewers:
yosin_UTC9, Xiaocheng
CC:
Xiaocheng, blink-reviews, chromium-reviews, groby+blinkspell_chromium.org, timvolodine
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add SpellChecker::GetSpellCheckMarkerTouchingSelection() This CL makes some changes to SpellChecker that I need to implement the Android spellcheck menu in Chrome. On most platforms, users can apply spellcheck suggestions by right-clicking in the interior of a misspelled word (nothing happens if you right-click at an endpoint) and selecting a replacement. On Android, the spellcheck menu is triggered by tapping on a word (either in the interior or at an endpoint). This means we need to do two things (both done in this CL): - Expose a way for a caller to determine if the selection (which may be an empty caret) is currently touching a spellcheck marker. If some text is actually selected, we can just see if any spellcheck markers on the text nodes making up the selected text intersect the selection. If we just have a caret selection, we need to create a range containing one character on either side and do the same operation. This method is being added as SpellChecker::GetSpellCheckMarkerTouchingSelection(). (Note: this will eventually be useful for suggestion markers as well once those are added, so we might want to consider putting this method somewhere else). - Make SpellChecker::ReplaceMisspelledRange() (which looks for a spellcheck marker intersecting the selection) work in the case where we have a caret selection touching the spellcheck marker. This is done by using the new GetSpellCheckMarkerTouchingSelection() method to find the marker. BUG=715365 Review-Url: https://codereview.chromium.org/2925363002 Cr-Commit-Position: refs/heads/master@{#478380} Committed: https://chromium.googlesource.com/chromium/src/+/3a98eaedc0233af64b6e647e3dd377321ee2861c

Patch Set 1 #

Total comments: 7

Patch Set 2 : Respond to comments #

Total comments: 3

Patch Set 3 : Respond to commments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+337 lines, -38 lines) Patch
M third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.h View 2 chunks +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp View 1 2 3 chunks +84 lines, -38 lines 0 comments Download
M third_party/WebKit/Source/core/editing/spellcheck/SpellCheckerTest.cpp View 1 chunk +250 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (16 generated)
rlanday
yosin@, I've split this off from https://codereview.chromium.org/2931443003 (Add support for Android spellcheck menu in Chrome/WebViews) ...
3 years, 6 months ago (2017-06-08 22:38:16 UTC) #4
yosin_UTC9
+xiaochengh@ for second look https://codereview.chromium.org/2925363002/diff/1/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp File third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp (right): https://codereview.chromium.org/2925363002/diff/1/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp#newcode836 third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp:836: const VisiblePosition& caret_pos = selection.VisibleStart(); ...
3 years, 6 months ago (2017-06-09 01:27:09 UTC) #10
rlanday
https://codereview.chromium.org/2925363002/diff/1/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp File third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp (right): https://codereview.chromium.org/2925363002/diff/1/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp#newcode847 third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp:847: return EphemeralRange(range_to_check_start, range_to_check_end); On 2017/06/09 at 01:27:09, yosin_UTC9 wrote: ...
3 years, 6 months ago (2017-06-09 01:49:12 UTC) #11
rlanday
Updated
3 years, 6 months ago (2017-06-09 02:11:45 UTC) #13
yosin_UTC9
On 2017/06/09 at 01:49:12, rlanday wrote: > https://codereview.chromium.org/2925363002/diff/1/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp > File third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp (right): > > https://codereview.chromium.org/2925363002/diff/1/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp#newcode847 ...
3 years, 6 months ago (2017-06-09 03:26:16 UTC) #15
yosin_UTC9
lgtm w/ nit https://codereview.chromium.org/2925363002/diff/20001/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp File third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp (right): https://codereview.chromium.org/2925363002/diff/20001/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp#newcode836 third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp:836: const VisiblePosition& caret_position = selection.VisibleStart(); Could ...
3 years, 6 months ago (2017-06-09 03:28:15 UTC) #16
Xiaocheng
Does this patch change the behavior on Win/Linux when right clicking at the edge of ...
3 years, 6 months ago (2017-06-09 04:17:27 UTC) #19
rlanday
On 2017/06/09 at 04:17:27, xiaochengh wrote: > Does this patch change the behavior on Win/Linux ...
3 years, 6 months ago (2017-06-09 04:46:20 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2925363002/40001
3 years, 6 months ago (2017-06-09 17:42:36 UTC) #23
Xiaocheng
lgtm
3 years, 6 months ago (2017-06-09 18:05:19 UTC) #24
commit-bot: I haz the power
3 years, 6 months ago (2017-06-09 19:46:34 UTC) #27
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/3a98eaedc0233af64b6e647e3dd3...

Powered by Google App Engine
This is Rietveld 408576698