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

Side by Side Diff: sky/engine/core/editing/SpellChecker.cpp

Issue 928393003: Remove the concept of document.documentElement (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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 | « sky/engine/core/editing/FrameSelection.cpp ('k') | sky/engine/core/editing/SurroundingText.h » ('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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 } 156 }
157 157
158 Position position = spellingSearchRange->startPosition(); 158 Position position = spellingSearchRange->startPosition();
159 if (!isEditablePosition(position)) { 159 if (!isEditablePosition(position)) {
160 // This shouldn't happen in very often because the Spelling menu items a ren't enabled unless the 160 // This shouldn't happen in very often because the Spelling menu items a ren't enabled unless the
161 // selection is editable. 161 // selection is editable.
162 // This can happen in Mail for a mix of non-editable and editable conten t (like Stationary), 162 // This can happen in Mail for a mix of non-editable and editable conten t (like Stationary),
163 // when spell checking the whole document before sending the message. 163 // when spell checking the whole document before sending the message.
164 // In that case the document might not be editable, but there are editab le pockets that need to be spell checked. 164 // In that case the document might not be editable, but there are editab le pockets that need to be spell checked.
165 165
166 position = firstEditableVisiblePositionAfterPositionInRoot(position, m_f rame.document()->documentElement()).deepEquivalent(); 166 position = firstEditableVisiblePositionAfterPositionInRoot(position, m_f rame.document()).deepEquivalent();
167 if (position.isNull()) 167 if (position.isNull())
168 return; 168 return;
169 169
170 Position rangeCompliantPosition = position.parentAnchoredEquivalent(); 170 Position rangeCompliantPosition = position.parentAnchoredEquivalent();
171 spellingSearchRange->setStart(rangeCompliantPosition.deprecatedNode(), r angeCompliantPosition.deprecatedEditingOffset(), IGNORE_EXCEPTION); 171 spellingSearchRange->setStart(rangeCompliantPosition.deprecatedNode(), r angeCompliantPosition.deprecatedEditingOffset(), IGNORE_EXCEPTION);
172 startedWithSelection = false; // won't need to wrap 172 startedWithSelection = false; // won't need to wrap
173 } 173 }
174 174
175 // topNode defines the whole range we want to operate on 175 // topNode defines the whole range we want to operate on
176 ContainerNode* topNode = highestEditableRoot(position); 176 ContainerNode* topNode = highestEditableRoot(position);
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 } 873 }
874 874
875 void SpellChecker::requestTextChecking(const Element& element) 875 void SpellChecker::requestTextChecking(const Element& element)
876 { 876 {
877 RefPtr<Range> rangeToCheck = rangeOfContents(const_cast<Element*>(&element)) ; 877 RefPtr<Range> rangeToCheck = rangeOfContents(const_cast<Element*>(&element)) ;
878 m_spellCheckRequester->requestCheckingFor(SpellCheckRequest::create(TextChec kingTypeSpelling | TextCheckingTypeGrammar, TextCheckingProcessBatch, rangeToChe ck, rangeToCheck)); 878 m_spellCheckRequester->requestCheckingFor(SpellCheckRequest::create(TextChec kingTypeSpelling | TextCheckingTypeGrammar, TextCheckingProcessBatch, rangeToChe ck, rangeToCheck));
879 } 879 }
880 880
881 881
882 } // namespace blink 882 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/editing/FrameSelection.cpp ('k') | sky/engine/core/editing/SurroundingText.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698