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

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

Issue 2142903003: Audit the use of updateStyleAndLayoutIgnorePendingStylesheets in DocumentMarkerController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Now with cool scope thingy. Created 4 years, 5 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 f3d97e5ed03ce1649805a78f62d30baf07abc2fe..0c89d47e76816c3c67a2a0e6d7c469ff7da1069c 100644
--- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
@@ -158,6 +158,8 @@ void SpellChecker::ignoreSpelling()
void SpellChecker::advanceToNextMisspelling(bool startBeforeSelection)
{
+ DocumentLifecycle::DisallowTransitionScope(frame().document()->lifecycle());
+
// The basic approach is to search in two phases - from the selection end to the end of the doc, and
// then we wrap and search from the doc start to (approximately) where we started.
@@ -304,7 +306,6 @@ void SpellChecker::advanceToNextMisspelling(bool startBeforeSelection)
const EphemeralRange badGrammarRange = calculateCharacterSubrange(EphemeralRange(grammarSearchStart, grammarSearchEnd), grammarPhraseOffset + grammarDetail.location, grammarDetail.length);
frame().selection().setSelection(VisibleSelection(badGrammarRange));
frame().selection().revealSelection();
-
frame().document()->markers().addMarker(badGrammarRange.startPosition(), badGrammarRange.endPosition(), DocumentMarker::Grammar, grammarDetail.userDescription);
} else if (!misspelledWord.isEmpty()) {
// We found a misspelling, but not any earlier bad grammar. Select the misspelling, update the spelling panel, and store
@@ -313,7 +314,6 @@ void SpellChecker::advanceToNextMisspelling(bool startBeforeSelection)
const EphemeralRange misspellingRange = calculateCharacterSubrange(EphemeralRange(spellingSearchStart, spellingSearchEnd), misspellingOffset, misspelledWord.length());
frame().selection().setSelection(VisibleSelection(misspellingRange));
frame().selection().revealSelection();
-
spellCheckerClient().updateSpellingUIWithMisspelledWord(misspelledWord);
frame().document()->markers().addMarker(misspellingRange.startPosition(), misspellingRange.endPosition(), DocumentMarker::Spelling);
}
@@ -647,7 +647,6 @@ void SpellChecker::markAndReplaceFor(SpellCheckRequest* request, const Vector<Te
frame().document()->markers().addMarker(invisibleSpellcheckRange.startPosition(), invisibleSpellcheckRange.endPosition(), DocumentMarker::InvisibleSpellcheck, result->replacement, result->hash);
}
}
-
}
if (selectionChanged) {

Powered by Google App Engine
This is Rietveld 408576698