| 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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 chunkAndMarkAllMisspellingsAndBadGrammar(fullParagraphToCheck); | 385 chunkAndMarkAllMisspellingsAndBadGrammar(fullParagraphToCheck); |
| 386 } | 386 } |
| 387 | 387 |
| 388 void SpellChecker::markMisspellingsAfterApplyingCommand( | 388 void SpellChecker::markMisspellingsAfterApplyingCommand( |
| 389 const CompositeEditCommand& cmd) { | 389 const CompositeEditCommand& cmd) { |
| 390 if (!isSpellCheckingEnabled()) | 390 if (!isSpellCheckingEnabled()) |
| 391 return; | 391 return; |
| 392 if (!isSpellCheckingEnabledFor(cmd.endingSelection())) | 392 if (!isSpellCheckingEnabledFor(cmd.endingSelection())) |
| 393 return; | 393 return; |
| 394 | 394 |
| 395 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets |
| 396 // needs to be audited. See http://crbug.com/590369 for more details. |
| 397 // In the long term we should use idle time spell checker to prevent |
| 398 // synchronous layout caused by spell checking (see crbug.com/517298). |
| 399 frame().document()->updateStyleAndLayoutIgnorePendingStylesheets(); |
| 400 |
| 395 // Use type-based conditioning instead of polymorphism so that all spell | 401 // Use type-based conditioning instead of polymorphism so that all spell |
| 396 // checking code can be encapsulated in SpellChecker. | 402 // checking code can be encapsulated in SpellChecker. |
| 397 | 403 |
| 398 if (cmd.isTypingCommand()) { | 404 if (cmd.isTypingCommand()) { |
| 399 markMisspellingsAfterTypingCommand(toTypingCommand(cmd)); | 405 markMisspellingsAfterTypingCommand(toTypingCommand(cmd)); |
| 400 return; | 406 return; |
| 401 } | 407 } |
| 402 | 408 |
| 403 if (!cmd.isReplaceSelectionCommand()) | 409 if (!cmd.isReplaceSelectionCommand()) |
| 404 return; | 410 return; |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1119 startOfNextParagraph(createVisiblePosition(paragraphEnd)); | 1125 startOfNextParagraph(createVisiblePosition(paragraphEnd)); |
| 1120 paragraphStart = newParagraphStart.toParentAnchoredPosition(); | 1126 paragraphStart = newParagraphStart.toParentAnchoredPosition(); |
| 1121 paragraphEnd = endOfParagraph(newParagraphStart).toParentAnchoredPosition(); | 1127 paragraphEnd = endOfParagraph(newParagraphStart).toParentAnchoredPosition(); |
| 1122 firstIteration = false; | 1128 firstIteration = false; |
| 1123 totalLengthProcessed += currentLength; | 1129 totalLengthProcessed += currentLength; |
| 1124 } | 1130 } |
| 1125 return std::make_pair(firstFoundItem, firstFoundOffset); | 1131 return std::make_pair(firstFoundItem, firstFoundOffset); |
| 1126 } | 1132 } |
| 1127 | 1133 |
| 1128 } // namespace blink | 1134 } // namespace blink |
| OLD | NEW |