Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Side by Side Diff: third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp

Issue 2419383007: Remove layout updates from Editor::{applied,unapplied,reapplied}Editing (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/editing/Editor.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/Editor.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698