| 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 ContainerNode* topNode = highestEditableRoot(position); | 202 ContainerNode* topNode = highestEditableRoot(position); |
| 203 // TODO(yosin): |lastOffsetForEditing()| is wrong here if | 203 // TODO(yosin): |lastOffsetForEditing()| is wrong here if |
| 204 // |editingIgnoresContent(highestEditableRoot())| returns true, e.g. <table> | 204 // |editingIgnoresContent(highestEditableRoot())| returns true, e.g. <table> |
| 205 spellingSearchEnd = Position::editingPositionOf(topNode, EditingStrategy::la
stOffsetForEditing(topNode)); | 205 spellingSearchEnd = Position::editingPositionOf(topNode, EditingStrategy::la
stOffsetForEditing(topNode)); |
| 206 | 206 |
| 207 // If spellingSearchRange starts in the middle of a word, advance to the | 207 // If spellingSearchRange starts in the middle of a word, advance to the |
| 208 // next word so we start checking at a word boundary. Going back by one char | 208 // next word so we start checking at a word boundary. Going back by one char |
| 209 // and then forward by a word does the trick. | 209 // and then forward by a word does the trick. |
| 210 if (startedWithSelection) { | 210 if (startedWithSelection) { |
| 211 VisiblePosition oneBeforeStart = previousPositionOf(createVisiblePositio
n(spellingSearchStart)); | 211 VisiblePosition oneBeforeStart = previousPositionOf(createVisiblePositio
n(spellingSearchStart)); |
| 212 if (oneBeforeStart.isNotNull() && rootEditableElementOf(oneBeforeStart)
== rootEditableElementOf(spellingSearchStart)) | 212 if (oneBeforeStart.isNotNull() && rootEditableElementOf(oneBeforeStart)
== editableRootForPosition(spellingSearchStart)) |
| 213 spellingSearchStart = endOfWord(oneBeforeStart).toParentAnchoredPosi
tion(); | 213 spellingSearchStart = endOfWord(oneBeforeStart).toParentAnchoredPosi
tion(); |
| 214 // else we were already at the start of the editable node | 214 // else we were already at the start of the editable node |
| 215 } | 215 } |
| 216 | 216 |
| 217 if (spellingSearchStart == spellingSearchEnd) | 217 if (spellingSearchStart == spellingSearchEnd) |
| 218 return; // nothing to search in | 218 return; // nothing to search in |
| 219 | 219 |
| 220 // We go to the end of our first range instead of the start of it, just to b
e sure | 220 // We go to the end of our first range instead of the start of it, just to b
e sure |
| 221 // we don't get foiled by any word boundary problems at the start. It means
we might | 221 // we don't get foiled by any word boundary problems at the start. It means
we might |
| 222 // do a tiny bit more searching. | 222 // do a tiny bit more searching. |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 916 m_spellCheckRequester->requestCheckingFor(SpellCheckRequest::create(TextChec
kingTypeSpelling | TextCheckingTypeGrammar, TextCheckingProcessBatch, rangeToChe
ck, rangeToCheck)); | 916 m_spellCheckRequester->requestCheckingFor(SpellCheckRequest::create(TextChec
kingTypeSpelling | TextCheckingTypeGrammar, TextCheckingProcessBatch, rangeToChe
ck, rangeToCheck)); |
| 917 } | 917 } |
| 918 | 918 |
| 919 DEFINE_TRACE(SpellChecker) | 919 DEFINE_TRACE(SpellChecker) |
| 920 { | 920 { |
| 921 visitor->trace(m_frame); | 921 visitor->trace(m_frame); |
| 922 visitor->trace(m_spellCheckRequester); | 922 visitor->trace(m_spellCheckRequester); |
| 923 } | 923 } |
| 924 | 924 |
| 925 } // namespace blink | 925 } // namespace blink |
| OLD | NEW |