OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 bool SpellChecker::isContinuousSpellCheckingEnabled() const | 96 bool SpellChecker::isContinuousSpellCheckingEnabled() const |
97 { | 97 { |
98 return spellCheckerClient().isContinuousSpellCheckingEnabled(); | 98 return spellCheckerClient().isContinuousSpellCheckingEnabled(); |
99 } | 99 } |
100 | 100 |
101 void SpellChecker::toggleContinuousSpellChecking() | 101 void SpellChecker::toggleContinuousSpellChecking() |
102 { | 102 { |
103 spellCheckerClient().toggleContinuousSpellChecking(); | 103 spellCheckerClient().toggleContinuousSpellChecking(); |
104 if (isContinuousSpellCheckingEnabled()) | 104 if (isContinuousSpellCheckingEnabled()) |
105 return; | 105 return; |
106 for (LocalFrame* frame = m_frame.page()->mainFrame(); frame && frame->docume
nt(); frame = frame->tree().traverseNext()) { | 106 for (Frame* frame = m_frame.page()->mainFrame(); frame; frame = frame->tree(
).traverseNext()) { |
107 for (Node* node = &frame->document()->rootNode(); node; node = NodeTrave
rsal::next(*node)) { | 107 if (!frame->isLocalFrame()) |
| 108 continue; |
| 109 for (Node* node = &toLocalFrame(frame)->document()->rootNode(); node; no
de = NodeTraversal::next(*node)) { |
108 node->setAlreadySpellChecked(false); | 110 node->setAlreadySpellChecked(false); |
109 } | 111 } |
110 } | 112 } |
111 } | 113 } |
112 | 114 |
113 bool SpellChecker::isGrammarCheckingEnabled() | 115 bool SpellChecker::isGrammarCheckingEnabled() |
114 { | 116 { |
115 return spellCheckerClient().isGrammarCheckingEnabled(); | 117 return spellCheckerClient().isGrammarCheckingEnabled(); |
116 } | 118 } |
117 | 119 |
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 } | 847 } |
846 | 848 |
847 void SpellChecker::requestTextChecking(const Element& element) | 849 void SpellChecker::requestTextChecking(const Element& element) |
848 { | 850 { |
849 RefPtrWillBeRawPtr<Range> rangeToCheck = rangeOfContents(const_cast<Element*
>(&element)); | 851 RefPtrWillBeRawPtr<Range> rangeToCheck = rangeOfContents(const_cast<Element*
>(&element)); |
850 m_spellCheckRequester->requestCheckingFor(SpellCheckRequest::create(TextChec
kingTypeSpelling | TextCheckingTypeGrammar, TextCheckingProcessBatch, rangeToChe
ck, rangeToCheck)); | 852 m_spellCheckRequester->requestCheckingFor(SpellCheckRequest::create(TextChec
kingTypeSpelling | TextCheckingTypeGrammar, TextCheckingProcessBatch, rangeToChe
ck, rangeToCheck)); |
851 } | 853 } |
852 | 854 |
853 | 855 |
854 } // namespace WebCore | 856 } // namespace WebCore |
OLD | NEW |