OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007 Apple, Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007 Apple, Inc. All rights reserved. |
3 * Copyright (C) 2012 Google, Inc. All rights reserved. | 3 * Copyright (C) 2012 Google, Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
89 if (m_spellCheckThisFieldStatus == SpellCheckForcedOn) | 89 if (m_spellCheckThisFieldStatus == SpellCheckForcedOn) |
90 return true; | 90 return true; |
91 return shouldSpellcheckByDefault(); | 91 return shouldSpellcheckByDefault(); |
92 } | 92 } |
93 | 93 |
94 void SpellCheckerClientImpl::toggleContinuousSpellChecking() | 94 void SpellCheckerClientImpl::toggleContinuousSpellChecking() |
95 { | 95 { |
96 if (isContinuousSpellCheckingEnabled()) { | 96 if (isContinuousSpellCheckingEnabled()) { |
97 m_spellCheckThisFieldStatus = SpellCheckForcedOff; | 97 m_spellCheckThisFieldStatus = SpellCheckForcedOff; |
98 if (Page* page = m_webView->page()) { | 98 if (Page* page = m_webView->page()) { |
99 for (LocalFrame* frame = page->mainFrame(); frame && frame->document (); frame = frame->tree().traverseNext()) { | 99 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree(). traverseNext()) { |
100 frame->document()->markers().removeMarkers(DocumentMarker::Missp ellingMarkers()); | 100 if (!frame->isLocalFrame()) |
101 continue; | |
102 if (!toLocalFrame(frame)->document()) | |
103 break; | |
dcheng
2014/06/04 18:06:37
groby, is it intentional that we break out of the
dcheng
2014/06/04 18:12:29
I mean *null* document, sorry for the confusion.
groby-ooo-7-16
2014/06/04 18:28:14
I'm not 100% certain - This was written by pstanek
dcheng
2014/06/04 20:08:30
In general, I don't think this is a normal conditi
| |
104 toLocalFrame(frame)->document()->markers().removeMarkers(Documen tMarker::MisspellingMarkers()); | |
101 } | 105 } |
102 } | 106 } |
103 } else { | 107 } else { |
104 m_spellCheckThisFieldStatus = SpellCheckForcedOn; | 108 m_spellCheckThisFieldStatus = SpellCheckForcedOn; |
105 if (m_webView->focusedWebCoreFrame()->isLocalFrame()) { | 109 if (m_webView->focusedWebCoreFrame()->isLocalFrame()) { |
106 if (LocalFrame* frame = toLocalFrame(m_webView->focusedWebCoreFrame( ))) { | 110 if (LocalFrame* frame = toLocalFrame(m_webView->focusedWebCoreFrame( ))) { |
107 VisibleSelection frameSelection = frame->selection().selection() ; | 111 VisibleSelection frameSelection = frame->selection().selection() ; |
108 // If a selection is in an editable element spell check its cont ent. | 112 // If a selection is in an editable element spell check its cont ent. |
109 if (Element* rootEditableElement = frameSelection.rootEditableEl ement()) { | 113 if (Element* rootEditableElement = frameSelection.rootEditableEl ement()) { |
110 frame->spellChecker().didBeginEditing(rootEditableElement); | 114 frame->spellChecker().didBeginEditing(rootEditableElement); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
224 } | 228 } |
225 | 229 |
226 bool SpellCheckerClientImpl::spellingUIIsShowing() | 230 bool SpellCheckerClientImpl::spellingUIIsShowing() |
227 { | 231 { |
228 if (m_webView->spellCheckClient()) | 232 if (m_webView->spellCheckClient()) |
229 return m_webView->spellCheckClient()->isShowingSpellingUI(); | 233 return m_webView->spellCheckClient()->isShowingSpellingUI(); |
230 return false; | 234 return false; |
231 } | 235 } |
232 | 236 |
233 } // namesace WebKit | 237 } // namesace WebKit |
OLD | NEW |