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

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

Issue 2701983002: Implement complete lifecycle transition for IdleSpellCheckCallback (Closed)
Patch Set: Add lifecycle transition unit tests Created 3 years, 9 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
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 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 } 732 }
733 733
734 void Editor::respondToChangedContents(const VisibleSelection& endingSelection) { 734 void Editor::respondToChangedContents(const VisibleSelection& endingSelection) {
735 if (frame().settings() && frame().settings()->getAccessibilityEnabled()) { 735 if (frame().settings() && frame().settings()->getAccessibilityEnabled()) {
736 Node* node = endingSelection.start().anchorNode(); 736 Node* node = endingSelection.start().anchorNode();
737 if (AXObjectCache* cache = frame().document()->existingAXObjectCache()) 737 if (AXObjectCache* cache = frame().document()->existingAXObjectCache())
738 cache->handleEditableTextContentChanged(node); 738 cache->handleEditableTextContentChanged(node);
739 } 739 }
740 740
741 spellChecker().updateMarkersForWordsAffectedByEditing(true); 741 spellChecker().updateMarkersForWordsAffectedByEditing(true);
742 frame().setNeedsSpellChecking();
yosin_UTC9 2017/02/23 05:20:48 Can we make Editor owns both SpellChecker and Idle
Xiaocheng 2017/02/23 20:46:07 I have the feeling that editing-related classes sh
yosin_UTC9 2017/02/24 02:10:53 I feel it is strange that SpellChecker tells Local
742 client().respondToChangedContents(); 743 client().respondToChangedContents();
743 } 744 }
744 745
745 void Editor::removeFormattingAndStyle() { 746 void Editor::removeFormattingAndStyle() {
746 DCHECK(frame().document()); 747 DCHECK(frame().document());
747 RemoveFormatCommand::create(*frame().document())->apply(); 748 RemoveFormatCommand::create(*frame().document())->apply();
748 } 749 }
749 750
750 void Editor::registerCommandGroup(CompositeEditCommand* commandGroupWrapper) { 751 void Editor::registerCommandGroup(CompositeEditCommand* commandGroupWrapper) {
751 DCHECK(commandGroupWrapper->isCommandGroupWrapper()); 752 DCHECK(commandGroupWrapper->isCommandGroupWrapper());
(...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after
1674 return; 1675 return;
1675 1676
1676 m_areMarkedTextMatchesHighlighted = flag; 1677 m_areMarkedTextMatchesHighlighted = flag;
1677 frame().document()->markers().repaintMarkers(DocumentMarker::TextMatch); 1678 frame().document()->markers().repaintMarkers(DocumentMarker::TextMatch);
1678 } 1679 }
1679 1680
1680 void Editor::respondToChangedSelection( 1681 void Editor::respondToChangedSelection(
1681 const Position& oldSelectionStart, 1682 const Position& oldSelectionStart,
1682 FrameSelection::SetSelectionOptions options) { 1683 FrameSelection::SetSelectionOptions options) {
1683 spellChecker().respondToChangedSelection(oldSelectionStart, options); 1684 spellChecker().respondToChangedSelection(oldSelectionStart, options);
1685 frame().setNeedsSpellChecking();
1684 client().respondToChangedSelection(&frame(), 1686 client().respondToChangedSelection(&frame(),
1685 frame() 1687 frame()
1686 .selection() 1688 .selection()
1687 .selectionInDOMTree() 1689 .selectionInDOMTree()
1688 .selectionTypeWithLegacyGranularity()); 1690 .selectionTypeWithLegacyGranularity());
1689 setStartNewKillRingSequence(true); 1691 setStartNewKillRingSequence(true);
1690 } 1692 }
1691 1693
1692 SpellChecker& Editor::spellChecker() const { 1694 SpellChecker& Editor::spellChecker() const {
1693 return frame().spellChecker(); 1695 return frame().spellChecker();
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1759 1761
1760 DEFINE_TRACE(Editor) { 1762 DEFINE_TRACE(Editor) {
1761 visitor->trace(m_frame); 1763 visitor->trace(m_frame);
1762 visitor->trace(m_lastEditCommand); 1764 visitor->trace(m_lastEditCommand);
1763 visitor->trace(m_undoStack); 1765 visitor->trace(m_undoStack);
1764 visitor->trace(m_mark); 1766 visitor->trace(m_mark);
1765 visitor->trace(m_typingStyle); 1767 visitor->trace(m_typingStyle);
1766 } 1768 }
1767 1769
1768 } // namespace blink 1770 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698