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