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

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

Issue 2711113004: Stop SpellChecker from adding marker when checking range is modified (Closed)
Patch Set: Created 3 years, 10 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/LayoutTests/editing/spelling/spellcheck-async-mutation-expected.txt ('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 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 return; 623 return;
624 } 624 }
625 625
626 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets 626 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
627 // needs to be audited. See http://crbug.com/590369 for more details. 627 // needs to be audited. See http://crbug.com/590369 for more details.
628 frame().document()->updateStyleAndLayoutIgnorePendingStylesheets(); 628 frame().document()->updateStyleAndLayoutIgnorePendingStylesheets();
629 629
630 DocumentLifecycle::DisallowTransitionScope disallowTransition( 630 DocumentLifecycle::DisallowTransitionScope disallowTransition(
631 frame().document()->lifecycle()); 631 frame().document()->lifecycle());
632 632
633 TextCheckingParagraph paragraph(request->checkingRange(), 633 EphemeralRange checkingRange(request->checkingRange());
634 request->checkingRange()); 634
635 // Abort marking if the content of the checking change has been modified.
636 String currentContent =
637 plainText(checkingRange,
638 TextIteratorBehavior::Builder()
639 .setEmitsObjectReplacementCharacter(true)
640 .build());
641 if (currentContent != request->data().text()) {
642 // "editing/spelling/spellcheck-async-mutation.html" reaches here.
643 return;
644 }
645
646 TextCheckingParagraph paragraph(checkingRange, checkingRange);
635 647
636 // TODO(xiaochengh): The following comment does not match the current behavior 648 // TODO(xiaochengh): The following comment does not match the current behavior
637 // and should be rewritten. 649 // and should be rewritten.
638 // Expand the range to encompass entire paragraphs, since text checking needs 650 // Expand the range to encompass entire paragraphs, since text checking needs
639 // that much context. 651 // that much context.
640 int selectionOffset = 0; 652 int selectionOffset = 0;
641 int ambiguousBoundaryOffset = -1; 653 int ambiguousBoundaryOffset = -1;
642 654
643 if (frame() 655 if (frame()
644 .selection() 656 .selection()
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
1218 startOfNextParagraph(createVisiblePosition(paragraphEnd)); 1230 startOfNextParagraph(createVisiblePosition(paragraphEnd));
1219 paragraphStart = newParagraphStart.toParentAnchoredPosition(); 1231 paragraphStart = newParagraphStart.toParentAnchoredPosition();
1220 paragraphEnd = endOfParagraph(newParagraphStart).toParentAnchoredPosition(); 1232 paragraphEnd = endOfParagraph(newParagraphStart).toParentAnchoredPosition();
1221 firstIteration = false; 1233 firstIteration = false;
1222 totalLengthProcessed += currentLength; 1234 totalLengthProcessed += currentLength;
1223 } 1235 }
1224 return std::make_pair(firstFoundItem, firstFoundOffset); 1236 return std::make_pair(firstFoundItem, firstFoundOffset);
1225 } 1237 }
1226 1238
1227 } // namespace blink 1239 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/editing/spelling/spellcheck-async-mutation-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698