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

Unified Diff: third_party/WebKit/Source/core/testing/Internals.cpp

Issue 2457523003: Support 'insertReplacementText' for spellcheck (Closed)
Patch Set: Created 4 years, 2 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/testing/Internals.cpp
diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp
index 21c35038a70d2d6ab26fc4ef12acada8418557f4..87dad2b4736e913857d15d0baa319e14becde77e 100644
--- a/third_party/WebKit/Source/core/testing/Internals.cpp
+++ b/third_party/WebKit/Source/core/testing/Internals.cpp
@@ -1791,6 +1791,17 @@ StaticNodeList* Internals::nodesFromRect(Document* document,
return StaticNodeList::adopt(matches);
}
+void Internals::setSpellingMarker(Document* document) {
+ DCHECK(document);
+ DCHECK(document->frame());
+
+ EphemeralRange range =
+ document->frame()->selection().selection().toNormalizedEphemeralRange();
+ document->markers().addMarker(range.startPosition(), range.endPosition(),
+ DocumentMarker::Spelling);
+ document->updateStyleAndLayoutIgnorePendingStylesheets();
+}
+
bool Internals::hasSpellingMarker(Document* document, int from, int length) {
ASSERT(document);
if (!document->frame())
@@ -1810,6 +1821,14 @@ void Internals::setSpellCheckingEnabled(bool enabled) {
contextDocument()->frame()->spellChecker().toggleSpellCheckingEnabled();
}
+void Internals::replaceMisspelled(Document* document,
+ const String& replacement) {
+ DCHECK(document);
+ DCHECK(document->frame());
+
+ document->frame()->spellChecker().replaceMisspelledRange(replacement);
+}
+
bool Internals::canHyphenate(const AtomicString& locale) {
return LayoutLocale::valueOrDefault(LayoutLocale::get(locale))
.getHyphenation();

Powered by Google App Engine
This is Rietveld 408576698