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

Side by Side Diff: Source/core/editing/SpellChecker.cpp

Issue 340013002: Rename {first,last}EditablePosition{After,Before}Position... to denote them returned VisiblePosition (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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 | « Source/core/editing/DeleteSelectionCommand.cpp ('k') | Source/core/editing/VisiblePosition.cpp » ('j') | 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 } 173 }
174 174
175 Position position = spellingSearchRange->startPosition(); 175 Position position = spellingSearchRange->startPosition();
176 if (!isEditablePosition(position)) { 176 if (!isEditablePosition(position)) {
177 // This shouldn't happen in very often because the Spelling menu items a ren't enabled unless the 177 // This shouldn't happen in very often because the Spelling menu items a ren't enabled unless the
178 // selection is editable. 178 // selection is editable.
179 // This can happen in Mail for a mix of non-editable and editable conten t (like Stationary), 179 // This can happen in Mail for a mix of non-editable and editable conten t (like Stationary),
180 // when spell checking the whole document before sending the message. 180 // when spell checking the whole document before sending the message.
181 // In that case the document might not be editable, but there are editab le pockets that need to be spell checked. 181 // In that case the document might not be editable, but there are editab le pockets that need to be spell checked.
182 182
183 position = firstEditablePositionAfterPositionInRoot(position, m_frame.do cument()->documentElement()).deepEquivalent(); 183 position = firstEditableVisiblePositionAfterPositionInRoot(position, m_f rame.document()->documentElement()).deepEquivalent();
184 if (position.isNull()) 184 if (position.isNull())
185 return; 185 return;
186 186
187 Position rangeCompliantPosition = position.parentAnchoredEquivalent(); 187 Position rangeCompliantPosition = position.parentAnchoredEquivalent();
188 spellingSearchRange->setStart(rangeCompliantPosition.deprecatedNode(), r angeCompliantPosition.deprecatedEditingOffset(), IGNORE_EXCEPTION); 188 spellingSearchRange->setStart(rangeCompliantPosition.deprecatedNode(), r angeCompliantPosition.deprecatedEditingOffset(), IGNORE_EXCEPTION);
189 startedWithSelection = false; // won't need to wrap 189 startedWithSelection = false; // won't need to wrap
190 } 190 }
191 191
192 // topNode defines the whole range we want to operate on 192 // topNode defines the whole range we want to operate on
193 Node* topNode = highestEditableRoot(position); 193 Node* topNode = highestEditableRoot(position);
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 } 847 }
848 848
849 void SpellChecker::requestTextChecking(const Element& element) 849 void SpellChecker::requestTextChecking(const Element& element)
850 { 850 {
851 RefPtrWillBeRawPtr<Range> rangeToCheck = rangeOfContents(const_cast<Element* >(&element)); 851 RefPtrWillBeRawPtr<Range> rangeToCheck = rangeOfContents(const_cast<Element* >(&element));
852 m_spellCheckRequester->requestCheckingFor(SpellCheckRequest::create(TextChec kingTypeSpelling | TextCheckingTypeGrammar, TextCheckingProcessBatch, rangeToChe ck, rangeToCheck)); 852 m_spellCheckRequester->requestCheckingFor(SpellCheckRequest::create(TextChec kingTypeSpelling | TextCheckingTypeGrammar, TextCheckingProcessBatch, rangeToChe ck, rangeToCheck));
853 } 853 }
854 854
855 855
856 } // namespace WebCore 856 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/editing/DeleteSelectionCommand.cpp ('k') | Source/core/editing/VisiblePosition.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698