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

Unified Diff: third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp

Issue 2533213003: [Editing] Use VisiblePosition stardOfWord for textarea in spell checker. (Closed)
Patch Set: update 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
Index: third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
index 9c18fd832fa73fb35cf9663e3df546986f988396..09180c0b33d185a5048041f167033598e7d71f3c 100644
--- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
@@ -72,10 +72,6 @@ bool isPositionInTextArea(const Position& position) {
return isHTMLTextAreaElement(textControl);
}
-bool isSelectionInTextFormControl(const VisibleSelection& selection) {
- return !!enclosingTextControl(selection.start());
-}
-
static bool isSpellCheckingEnabledFor(const Position& position) {
if (position.isNull())
return false;
@@ -900,16 +896,9 @@ void SpellChecker::respondToChangedSelection(
VisibleSelection newAdjacentWords;
const VisibleSelection newSelection = frame().selection().selection();
- if (isSelectionInTextFormControl(newSelection)) {
- const Position newStart = newSelection.start();
- newAdjacentWords.setWithoutValidation(
- TextControlElement::startOfWord(newStart),
- TextControlElement::endOfWord(newStart));
- } else {
- if (newSelection.isContentEditable()) {
- newAdjacentWords =
- createVisibleSelection(selectWord(newSelection.visibleStart()));
- }
+ if (newSelection.isContentEditable()) {
+ newAdjacentWords =
+ createVisibleSelection(selectWord(newSelection.visibleStart()));
}
// When typing we check spelling elsewhere, so don't redo it here.

Powered by Google App Engine
This is Rietveld 408576698