New issue
Advanced search Search tips

Issue 720065 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Feature



Sign in to add a comment

Fix spellchecker to support misspelled words that span multiple nodes

Project Member Reported by rlanday@chromium.org, May 9 2017

Issue description

Chrome Version: 58.0.3029.96 (Official Build) (64-bit)
OS: All

What steps will reproduce the problem?
(1) On a desktop version of Chrome (Mac/Windows/Linux), type this in the URL bar and hit enter:
data:text/html, <div contenteditable><b>cho</b>rme</div>
(2) Right-click inside "cho" and inside "rme" and view the context menu

What is the expected result?
"chorme" is selected and spellcheck suggestions for "chorme" are shown"

What happens instead?
"cho" or "rme" is selected (depending on the location clicked) and spellcheck suggestions are shown for "cho" or "rme".



The issue occurs because DocumentMarkers, used to mark the misspelled ranges, cannot span multiple nodes (both the start and end position of the marker must be anchored relative to the same node). The problem could probably be fixed by changing the way DocumentMarkers are created and stored so the start and end positions can be relative to different nodes (like how DOM ranges work). Right now DocumentMarkerController:AddMarker() takes a pair of positions (note: this will probably be changed to an EphemeralRange at some point, but that's a minor detail) and uses TextIterator to split up the spelling marker across all the nodes involved. This would probably need to be changed to create a single marker that spans the whole range.

We might also need to update the code that selects the misspelled word when you right-click:
https://chromium.googlesource.com/chromium/src/+/d909708dbf4f72ab2cc60b3021832aeaa22c0580/third_party/WebKit/Source/core/editing/SelectionController.cpp#530

and the code that replaces the misspelled word when a suggestion is chosen:
https://chromium.googlesource.com/chromium/src/+/1945a87fa4e60d4749fc02db1a939e21c3470e63/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp#819


 
Description: Show this description

Comment 2 by yosin@chromium.org, Jun 27 2017

Labels: -Type-Bug Type-Feature
Note: this works in Safari and Firefox (both browsers leave the entire word bolded after the replacement). They both have a minor bug in that after you undo the replacement, the red underline only appears under the first part of the word until you start typing again.
Project Member

Comment 4 by sheriffbot@chromium.org, Jul 25

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
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
Cc: -editing-dev@chromium.org -xiaoche...@chromium.org -yosin@chromium.org -rlanday@chromium.org
Status: Available (was: Untriaged)

Sign in to add a comment