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

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-08T18:08:39 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..f97e73703b3312b7a184cef46a346e29f7b16325 100644
--- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
@@ -564,8 +564,17 @@ void SpellChecker::markAndReplaceFor(SpellCheckRequest* request, const Vector<Te
{
TRACE_EVENT0("blink", "SpellChecker::markAndReplaceFor");
DCHECK(request);
+ 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());
« no previous file with comments | « third_party/WebKit/Source/core/editing/SelectionEditor.cpp ('k') | third_party/WebKit/Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698