| Index: Source/web/SpellCheckerClientImpl.cpp
|
| diff --git a/Source/web/SpellCheckerClientImpl.cpp b/Source/web/SpellCheckerClientImpl.cpp
|
| index 224be4ec2ebb57d3c3771571734cdac93e55f4da..4425752dcb9b5987a102aca9c8473a2d61716026 100644
|
| --- a/Source/web/SpellCheckerClientImpl.cpp
|
| +++ b/Source/web/SpellCheckerClientImpl.cpp
|
| @@ -56,7 +56,9 @@ bool SpellCheckerClientImpl::shouldSpellcheckByDefault()
|
| {
|
| // Spellcheck should be enabled for all editable areas (such as textareas,
|
| // contentEditable regions, designMode docs and inputs).
|
| - const LocalFrame* frame = m_webView->focusedWebCoreFrame();
|
| + if (!m_webView->focusedWebCoreFrame()->isLocalFrame())
|
| + return false;
|
| + const LocalFrame* frame = toLocalFrame(m_webView->focusedWebCoreFrame());
|
| if (!frame)
|
| return false;
|
| if (frame->spellChecker().isSpellCheckingEnabledInFocusedNode())
|
| @@ -100,11 +102,13 @@ void SpellCheckerClientImpl::toggleContinuousSpellChecking()
|
| }
|
| } else {
|
| m_spellCheckThisFieldStatus = SpellCheckForcedOn;
|
| - if (LocalFrame* frame = m_webView->focusedWebCoreFrame()) {
|
| - VisibleSelection frameSelection = frame->selection().selection();
|
| - // If a selection is in an editable element spell check its content.
|
| - if (Element* rootEditableElement = frameSelection.rootEditableElement()) {
|
| - frame->spellChecker().didBeginEditing(rootEditableElement);
|
| + if (m_webView->focusedWebCoreFrame()->isLocalFrame()) {
|
| + if (LocalFrame* frame = toLocalFrame(m_webView->focusedWebCoreFrame())) {
|
| + VisibleSelection frameSelection = frame->selection().selection();
|
| + // If a selection is in an editable element spell check its content.
|
| + if (Element* rootEditableElement = frameSelection.rootEditableElement()) {
|
| + frame->spellChecker().didBeginEditing(rootEditableElement);
|
| + }
|
| }
|
| }
|
| }
|
| @@ -112,13 +116,13 @@ void SpellCheckerClientImpl::toggleContinuousSpellChecking()
|
|
|
| bool SpellCheckerClientImpl::isGrammarCheckingEnabled()
|
| {
|
| - const LocalFrame* frame = m_webView->focusedWebCoreFrame();
|
| + const LocalFrame* frame = toLocalFrame(m_webView->focusedWebCoreFrame());
|
| return frame && frame->settings() && (frame->settings()->asynchronousSpellCheckingEnabled() || frame->settings()->unifiedTextCheckerEnabled());
|
| }
|
|
|
| bool SpellCheckerClientImpl::shouldEraseMarkersAfterChangeSelection(TextCheckingType type) const
|
| {
|
| - const LocalFrame* frame = m_webView->focusedWebCoreFrame();
|
| + const Frame* frame = m_webView->focusedWebCoreFrame();
|
| return !frame || !frame->settings() || (!frame->settings()->asynchronousSpellCheckingEnabled() && !frame->settings()->unifiedTextCheckerEnabled());
|
| }
|
|
|
|
|