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 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 return; | 702 return; |
703 } | 703 } |
704 | 704 |
705 if (startOfFirstWord.isNull() || endOfFirstWord.isNull() || startOfLastWord.
isNull() || endOfLastWord.isNull()) | 705 if (startOfFirstWord.isNull() || endOfFirstWord.isNull() || startOfLastWord.
isNull() || endOfLastWord.isNull()) |
706 return; | 706 return; |
707 | 707 |
708 // Now we remove markers on everything between startOfFirstWord and endOfLas
tWord. | 708 // Now we remove markers on everything between startOfFirstWord and endOfLas
tWord. |
709 // However, if an autocorrection change a single word to multiple words, we
want to remove correction mark from all the | 709 // However, if an autocorrection change a single word to multiple words, we
want to remove correction mark from all the |
710 // resulted words even we only edit one of them. For example, assuming autoc
orrection changes "avantgarde" to "avant | 710 // resulted words even we only edit one of them. For example, assuming autoc
orrection changes "avantgarde" to "avant |
711 // garde", we will have CorrectionIndicator marker on both words and on the
whitespace between them. If we then edit garde, | 711 // garde", we will have CorrectionIndicator marker on both words and on the
whitespace between them. If we then edit garde, |
712 // we would like to remove the marker from word "avant" and whitespace as we
ll. So we need to get the continous range of | 712 // we would like to remove the marker from word "avant" and whitespace as we
ll. So we need to get the continuous range of |
713 // of marker that contains the word in question, and remove marker on that w
hole range. | 713 // of marker that contains the word in question, and remove marker on that w
hole range. |
714 Document* document = frame().document(); | 714 Document* document = frame().document(); |
715 ASSERT(document); | 715 ASSERT(document); |
716 Node* startNode = startOfFirstWord.deepEquivalent().computeContainerNode(); | 716 Node* startNode = startOfFirstWord.deepEquivalent().computeContainerNode(); |
717 int startOffset = startOfFirstWord.deepEquivalent().computeOffsetInContainer
Node(); | 717 int startOffset = startOfFirstWord.deepEquivalent().computeOffsetInContainer
Node(); |
718 int endOffset = endOfLastWord.deepEquivalent().computeOffsetInContainerNode(
); | 718 int endOffset = endOfLastWord.deepEquivalent().computeOffsetInContainerNode(
); |
719 document->markers().removeMarkers(startNode, startOffset, endOffset - startO
ffset, DocumentMarker::MisspellingMarkers(), DocumentMarkerController::RemovePar
tiallyOverlappingMarker); | 719 document->markers().removeMarkers(startNode, startOffset, endOffset - startO
ffset, DocumentMarker::MisspellingMarkers(), DocumentMarkerController::RemovePar
tiallyOverlappingMarker); |
720 } | 720 } |
721 | 721 |
722 void SpellChecker::didEndEditingOnTextField(Element* e) | 722 void SpellChecker::didEndEditingOnTextField(Element* e) |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
929 m_spellCheckRequester->requestCheckingFor(SpellCheckRequest::create(TextChec
kingTypeSpelling | TextCheckingTypeGrammar, TextCheckingProcessBatch, rangeToChe
ck, rangeToCheck)); | 929 m_spellCheckRequester->requestCheckingFor(SpellCheckRequest::create(TextChec
kingTypeSpelling | TextCheckingTypeGrammar, TextCheckingProcessBatch, rangeToChe
ck, rangeToCheck)); |
930 } | 930 } |
931 | 931 |
932 DEFINE_TRACE(SpellChecker) | 932 DEFINE_TRACE(SpellChecker) |
933 { | 933 { |
934 visitor->trace(m_frame); | 934 visitor->trace(m_frame); |
935 visitor->trace(m_spellCheckRequester); | 935 visitor->trace(m_spellCheckRequester); |
936 } | 936 } |
937 | 937 |
938 } // namespace blink | 938 } // namespace blink |
OLD | NEW |