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

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

Issue 1679173003: Fix a crash by AdvanceToNextMisspelling command (⌘-;) with empty INPUT (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't change html.css Created 4 years, 10 months 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 4dac0578c2f9090339dc04554532273de99dd462..63ef51ded5415366a30c2dddea4804cb8bcded7e 100644
--- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
@@ -208,8 +208,8 @@ void SpellChecker::advanceToNextMisspelling(bool startBeforeSelection)
// next word so we start checking at a word boundary. Going back by one char
// and then forward by a word does the trick.
if (startedWithSelection) {
- VisiblePosition oneBeforeStart = previousPositionOf(createVisiblePosition(spellingSearchStart));
- if (oneBeforeStart.isNotNull())
+ VisiblePosition oneBeforeStart = previousPositionOf(createVisiblePosition(spellingSearchStart));
+ if (oneBeforeStart.isNotNull() && rootEditableElementOf(oneBeforeStart) == rootEditableElementOf(spellingSearchStart))
spellingSearchStart = endOfWord(oneBeforeStart).toParentAnchoredPosition();
// else we were already at the start of the editable node
}
« no previous file with comments | « third_party/WebKit/Source/core/core.gypi ('k') | third_party/WebKit/Source/core/editing/spellcheck/SpellCheckerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698