| 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 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 VisibleSelection empty; | 857 VisibleSelection empty; |
| 858 spellCheckOldSelection(frame().selection().selection(), empty); | 858 spellCheckOldSelection(frame().selection().selection(), empty); |
| 859 } | 859 } |
| 860 | 860 |
| 861 void SpellChecker::spellCheckOldSelection(const VisibleSelection& oldSelection,
const VisibleSelection& newAdjacentWords) | 861 void SpellChecker::spellCheckOldSelection(const VisibleSelection& oldSelection,
const VisibleSelection& newAdjacentWords) |
| 862 { | 862 { |
| 863 TRACE_EVENT0("blink", "SpellChecker::spellCheckOldSelection"); | 863 TRACE_EVENT0("blink", "SpellChecker::spellCheckOldSelection"); |
| 864 | 864 |
| 865 VisiblePosition oldStart(oldSelection.visibleStart()); | 865 VisiblePosition oldStart(oldSelection.visibleStart()); |
| 866 VisibleSelection oldAdjacentWords = VisibleSelection(startOfWord(oldStart, L
eftWordIfOnBoundary), endOfWord(oldStart, RightWordIfOnBoundary)); | 866 VisibleSelection oldAdjacentWords = VisibleSelection(startOfWord(oldStart, L
eftWordIfOnBoundary), endOfWord(oldStart, RightWordIfOnBoundary)); |
| 867 if (oldAdjacentWords != newAdjacentWords) { | 867 if (oldAdjacentWords == newAdjacentWords) |
| 868 if (isContinuousSpellCheckingEnabled()) { | 868 return; |
| 869 VisibleSelection selectedSentence = VisibleSelection(startOfSentence
(oldStart), endOfSentence(oldStart)); | 869 if (isContinuousSpellCheckingEnabled()) { |
| 870 markMisspellingsAndBadGrammar(oldAdjacentWords, true, selectedSenten
ce); | 870 VisibleSelection selectedSentence = VisibleSelection(startOfSentence(old
Start), endOfSentence(oldStart)); |
| 871 } else { | 871 markMisspellingsAndBadGrammar(oldAdjacentWords, true, selectedSentence); |
| 872 markMisspellingsAndBadGrammar(oldAdjacentWords, false, oldAdjacentWo
rds); | 872 return; |
| 873 } | |
| 874 } | 873 } |
| 874 markMisspellingsAndBadGrammar(oldAdjacentWords, false, oldAdjacentWords); |
| 875 } | 875 } |
| 876 | 876 |
| 877 static Node* findFirstMarkable(Node* node) | 877 static Node* findFirstMarkable(Node* node) |
| 878 { | 878 { |
| 879 while (node) { | 879 while (node) { |
| 880 if (!node->layoutObject()) | 880 if (!node->layoutObject()) |
| 881 return 0; | 881 return 0; |
| 882 if (node->layoutObject()->isText()) | 882 if (node->layoutObject()->isText()) |
| 883 return node; | 883 return node; |
| 884 if (node->layoutObject()->isTextControl()) | 884 if (node->layoutObject()->isTextControl()) |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 958 visitor->trace(m_frame); | 958 visitor->trace(m_frame); |
| 959 visitor->trace(m_spellCheckRequester); | 959 visitor->trace(m_spellCheckRequester); |
| 960 } | 960 } |
| 961 | 961 |
| 962 void SpellChecker::prepareForLeakDetection() | 962 void SpellChecker::prepareForLeakDetection() |
| 963 { | 963 { |
| 964 m_spellCheckRequester->prepareForLeakDetection(); | 964 m_spellCheckRequester->prepareForLeakDetection(); |
| 965 } | 965 } |
| 966 | 966 |
| 967 } // namespace blink | 967 } // namespace blink |
| OLD | NEW |