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

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

Issue 2001083002: Explicit management of FrameSelection availability (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-06-06T17:09:04 Created 4 years, 6 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 fa176f6a239d279acfd1c9a9ded9279efb361b98..2bc9902491fa39febb456a11e7810a95783016bc 100644
--- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
@@ -563,9 +563,17 @@ void SpellChecker::chunkAndMarkAllMisspellingsAndBadGrammar(TextCheckingTypeMask
void SpellChecker::markAndReplaceFor(SpellCheckRequest* request, const Vector<TextCheckingResult>& results)
{
TRACE_EVENT0("blink", "SpellChecker::markAndReplaceFor");
- DCHECK(request);
tkent 2016/06/07 23:41:59 Why do you remove the DCHECK?
yosin_UTC9 2016/06/08 04:06:10 Oops, it should be here. Done.
+ if (!frame().selection().isAvailable()) {
+ // "editing/spelling/spellcheck-async-remove-frame.html" reaches here.
+ return;
+ }
if (!request->isValid())
return;
+ if (request->rootEditableElement()->document() != frame().selection().document()) {
+ // we ignore |request| made for another document.
+ // "editing/spelling/spellcheck-sequencenum.html" and others reach here.
+ return;
+ }
TextCheckingTypeMask textCheckingOptions = request->data().mask();
TextCheckingParagraph paragraph(request->checkingRange(), request->paragraphRange());

Powered by Google App Engine
This is Rietveld 408576698