| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |