Chromium Code Reviews| 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 516e77e6cae6eb43cd98e2da9b08250c461bee79..fbb4bb0472a69ed833026b3febe3c62fee4e84fd 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); |
|
yosin_UTC9
2016/10/28 04:06:14
Please throw an exception rather than DCHECK().
Cl
|
| + DCHECK(document->frame()); |
| + |
|
Xiaocheng
2016/10/28 02:55:24
Please call |document->updateStyleAndLayoutIgnoreP
|
| + EphemeralRange range = |
| + document->frame()->selection().selection().toNormalizedEphemeralRange(); |
| + document->markers().addMarker(range.startPosition(), range.endPosition(), |
| + DocumentMarker::Spelling); |
| + document->updateStyleAndLayoutIgnorePendingStylesheets(); |
|
Xiaocheng
2016/10/28 02:55:24
I don't think we should update layout here.
|
| +} |
| + |
| 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); |
|
yosin_UTC9
2016/10/28 04:06:14
Please throw an exception rather than DCHECK().
Cl
|
| + DCHECK(document->frame()); |
| + |
|
Xiaocheng
2016/10/28 02:55:23
Please call document->updateStyleAndLayoutIgnorePe
|
| + document->frame()->spellChecker().replaceMisspelledRange(replacement); |
| +} |
| + |
| bool Internals::canHyphenate(const AtomicString& locale) { |
| return LayoutLocale::valueOrDefault(LayoutLocale::get(locale)) |
| .getHyphenation(); |