| Index: Source/web/EditorClientImpl.cpp
|
| diff --git a/Source/web/EditorClientImpl.cpp b/Source/web/EditorClientImpl.cpp
|
| index 7b1741f745c17796b0a3682855d928f09c418d0a..dd98af051d6de7c048c94321b2082746a9621074 100644
|
| --- a/Source/web/EditorClientImpl.cpp
|
| +++ b/Source/web/EditorClientImpl.cpp
|
| @@ -46,10 +46,12 @@
|
| #include "WebViewClient.h"
|
| #include "WebViewImpl.h"
|
| #include "core/dom/Document.h"
|
| +#include "core/dom/DocumentMarkerController.h"
|
| #include "core/dom/EventNames.h"
|
| #include "core/dom/KeyboardEvent.h"
|
| #include "core/editing/Editor.h"
|
| #include "core/editing/SpellChecker.h"
|
| +#include "core/editing/TextCheckingHelper.h"
|
| #include "core/editing/UndoStep.h"
|
| #include "core/html/HTMLInputElement.h"
|
| #include "core/page/EventHandler.h"
|
| @@ -139,10 +141,26 @@ bool EditorClientImpl::isContinuousSpellCheckingEnabled()
|
|
|
| void EditorClientImpl::toggleContinuousSpellChecking()
|
| {
|
| - if (isContinuousSpellCheckingEnabled())
|
| + if (isContinuousSpellCheckingEnabled()) {
|
| m_spellCheckThisFieldStatus = SpellCheckForcedOff;
|
| - else
|
| + if (Page* page = m_webView->page()) {
|
| + for (Frame* frame = page->mainFrame(); frame && frame->document(); frame = frame->tree()->traverseNext()) {
|
| + frame->document()->markers()->removeMarkers(DocumentMarker::Spelling | DocumentMarker::Grammar);
|
| + }
|
| + }
|
| + } else {
|
| m_spellCheckThisFieldStatus = SpellCheckForcedOn;
|
| + if (Frame* frame = m_webView->focusedWebCoreFrame()) {
|
| + if (unifiedTextCheckerEnabled(frame)) {
|
| + VisibleSelection frameSelection = frame->selection()->selection();
|
| + // If a selection is in an editable element spell check its content.
|
| + if (Element* rootEditableElement = frameSelection.rootEditableElement()) {
|
| + VisibleSelection selection = VisibleSelection::selectionFromContentsOfNode(rootEditableElement);
|
| + frame->editor()->markMisspellingsAndBadGrammar(selection);
|
| + }
|
| + }
|
| + }
|
| + }
|
| }
|
|
|
| bool EditorClientImpl::isGrammarCheckingEnabled()
|
|
|